Skip to content

Commit

Permalink
Updates, getting started on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Oct 5, 2024
1 parent 8080366 commit d040334
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ makedocs(;
),
pages=[
"Home" => "index.md",
"Getting Started" => "regiongrids.md",
],
)

Expand Down
8 changes: 6 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
45 changes: 45 additions & 0 deletions docs/src/regiongrids.md
Original file line number Diff line number Diff line change
@@ -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
```
20 changes: 19 additions & 1 deletion src/RegionGrids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d040334

Please sign in to comment.