From d040334a7c3a0f9735df3f193975584bde4cae2e Mon Sep 17 00:00:00 2001 From: Nathanael Wong Date: Sat, 5 Oct 2024 13:17:34 -0400 Subject: [PATCH] Updates, getting started on documentation --- docs/make.jl | 1 + docs/src/index.md | 8 ++++++-- docs/src/regiongrids.md | 45 +++++++++++++++++++++++++++++++++++++++++ src/RegionGrids.jl | 20 +++++++++++++++++- 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 docs/src/regiongrids.md diff --git a/docs/make.jl b/docs/make.jl index 573235f..0140b30 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -18,6 +18,7 @@ makedocs(; ), pages=[ "Home" => "index.md", + "Getting Started" => "regiongrids.md", ], ) diff --git a/docs/src/index.md b/docs/src/index.md index 897a3d9..84b8a16 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -4,8 +4,8 @@ layout: home hero: name: "RegionGrids.jl" - text: "Extraction of Gridded Data for Geospatial Data" - tagline: Extracting Gridded Geospatial Data for Geographic Regions of Interest. + text: "Extraction of Gridded Geospatial Data" + tagline: Subsetting and Extracting Gridded Geospatial Data for Geographic Regions of Interest. image: src: /logo.png alt: RegionGrids @@ -33,6 +33,10 @@ features: --- ``` +## Introduction + +RegionGrids.jl is a lightweight Julia package that builds upon [GeoRegions.jl](https://github.com/GeoRegionsEcosystem/GeoRegions.jl), and allows for the subsetting and extraction of gridded data for a given geographical region of interest. + ## Installation Instructions The latest version of RegionGrids can be installed using the Julia package manager (accessed by pressing `]` in the Julia command prompt) diff --git a/docs/src/regiongrids.md b/docs/src/regiongrids.md new file mode 100644 index 0000000..5b514de --- /dev/null +++ b/docs/src/regiongrids.md @@ -0,0 +1,45 @@ +# What is a RegionGrid? + +A `RegionGrid` contains information that: +* Allows us to extract gridded lon-lat data for a given `GeoRegion` (see [GeoRegions.jl](https://github.com/GeoRegionsEcosystem/GeoRegions.jl)) of interest. +* Subset the relevant longitude/latitude vectors from the initial grid. +* Allows for easy spatial-averaging of extracted gridded lon-lat data, weighted by latitude. + +```@docs +RegionGrid +``` + +## Types of RegionGrids + +The `RegionGrid` abstract type has two subtypes: +1. `RectilinearGrid` type, which is for the extraction of data on rectilinear lon-lat grids +2. `GeneralizedGrid` type, which is for the extraction of data on non-rectilinear lon-lat grids + +```@docs +RectilinearGrid +GeneralizedGrid +``` + +### The `Rectilinear` Grid + +The `RectilinearGrid` type can be further subdivided into three different types based on the `GeoRegion` type: +* Mapping rectilinearly-gridded lon-lat data to a **`RectRegion`** gives a `RectGrid` type +* Mapping rectilinearly-gridded lon-lat data to a **`PolyRegion`** gives a `PolyGrid` type +* Mapping rectilinearly-gridded lon-lat data to a **`TiltRegion`** gives a `TiltGrid` type + +```@docs +RectGrid +PolyGrid +TiltGrid +``` + +### The `GeneralizedGrid` Type + +The `GeneralizedGrid` type can be further subdivided into two different types based on the `GeoRegion` type: +* Mapping generalized grid lon-lat data to a `RectRegion` or `PolyRegion` gives a `RegionMask` type +* Mapping rectilinearly-gridded lon-lat data to a **`TiltRegion`** gives a `RegionTilt` type + +```@docs +RegionMask +RegionTilt +``` \ No newline at end of file diff --git a/src/RegionGrids.jl b/src/RegionGrids.jl index 86ef7ea..58a9a1e 100644 --- a/src/RegionGrids.jl +++ b/src/RegionGrids.jl @@ -76,7 +76,7 @@ end Information on a `RectilinearGrid` type that is extracted based on a `TiltRegion` type. -In addition to all the fields common to the `RegionGrid` abstract type, `TiltGrid`s type will also contain the following fields: +In addition to all the fields common to the `RectilinearGrid` abstract type, `TiltGrid`s type will also contain the following fields: * `rotX` - A vector of `Float`s, defining indices of the parent longitude vector describing the region * `rotY` - A vector of `Float`s, defining indices of the parent latitude vector describing the region """ @@ -116,6 +116,24 @@ struct RegionMask{FT<:Real} <: GeneralizedGrid weights :: Array{FT,2} end +""" + RegionTilt <: GeneralizedGrid + +Information on a `GeneralizedGrid` type that is extracted based on arrays of longitude/latitude points. + +In addition to all the fields common to the `GeneralizedGrid` abstract type, `RegionTilt`s type will also contain the following fields: +* `rotX` - A vector of `Float`s, defining indices of the parent longitude vector describing the region +* `rotY` - A vector of `Float`s, defining indices of the parent latitude vector describing the region +""" +struct RegionTilt{FT<:Real} <: GeneralizedGrid + lon :: Array{FT,2} + lat :: Array{FT,2} + mask :: Array{FT,2} + weights :: Array{FT,2} + rotX :: Array{FT,2} + rotY :: Array{FT,2} +end + """ VectorMask <: GeneralizedGrid