Skip to content

Commit 7427280

Browse files
committed
Some documentation updates
1 parent 77cc20f commit 7427280

File tree

7 files changed

+337
-13
lines changed

7 files changed

+337
-13
lines changed

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
55
LandSea = "cbf7bb22-a1a6-46cb-8b24-174e3bc5fc04"
6+
7+
[compat]
8+
DocumenterVitepress = "0.2"

docs/make.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ makedocs(;
1515
),
1616
pages=[
1717
"Home" => "index.md",
18-
"Getting Started" => "landsea.md",
19-
# "Basic Example" => "example.md",
20-
"API List" => "api.md",
18+
"Getting Started" => "basics.md",
19+
"Dataset Types" => "landsea.md",
2120
],
2221
)
2322

docs/src/api.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/src/basics.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# How to use LandSea.jl
2+
3+
As mentioned on the [home](index) page, LandSea.jl is a backend package that allows a user to import and handle land-sea masks and topographic data. Examples of such land-sea mask datasets include:
4+
* ERA5 reanalysis land-sea masks and topographic data (0.25º or T639 spectral)
5+
* NASA IMERG land-sea mask (0.1º)
6+
* ETOPO topographic datasets, with land-sea mask estimation
7+
8+
## Retrieving a LandSea Dataset
9+
10+
To retrieve Land-Sea dataset, we recommend extending the `getLandSea()` function exported by LandSea.jl as needed via the following method:
11+
12+
```julia
13+
import LandSea: getLandSea
14+
15+
function getLandSea(
16+
ids :: <Dataset Type of Interest>,
17+
geo :: GeoRegion
18+
)
19+
20+
...
21+
22+
end
23+
```
24+
25+
See the docs below:
26+
```@docs
27+
getLandSea
28+
```
29+
30+
## Examples
31+
32+
The following packages serve as examples of how LandSea.jl can be used to download topographic and land-sea mask information:
33+
* ERA5Reanalysis.jl [(GitHub)](https://github.com/GeoRegionsEcosystem/ERA5Reanalysis.jl) [(documentation)](https://georegionsecosystem.github.io/ERA5Reanalysis.jl/stable/) [(source code)](https://github.com/GeoRegionsEcosystem/ERA5Reanalysis.jl/tree/main/src/landsea)
34+
* NASAPrecipitation.jl [(GitHub)](https://github.com/GeoRegionsEcosystem/NASAPrecipitation.jl) [(documentation)](https://georegionsecosystem.github.io/NASAPrecipitation.jl/stable/) [(source code)](https://github.com/GeoRegionsEcosystem/NASAPrecipitation.jl/tree/main/src/landsea)

docs/src/landsea.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,21 @@ A `LandSeaData` type contains information on:
55
* The Land-Sea mask containing information on how where land and ocean are in the region of interest
66
* The topography, where available, of the region of interest
77

8-
## The Types of `LandSeaData`s
8+
```@docs
9+
LandSeaData
10+
```
911

1012
The `LandSeaData` abstract type has two subtypes:
1113
1. `LandSeaFlat` type, which contains only information on the Land-Sea mask but has no information on topography
12-
2. `LandSeaTopo` type, which contains information on both the Land-Sea mask and the topography
14+
2. `LandSeaTopo` type, which contains information on both the Land-Sea mask and the topography
15+
16+
## The `LandSeaFlat` Type
17+
18+
```@docs
19+
LandSeaFlat
20+
```
21+
## The `LandSeaTopo` Type
22+
23+
```@docs
24+
LandSeaTopo
25+
```

src/LandSea.jl

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export
1919
Abstract supertype for LandSea Datasets. All `LandSeaData` types contain the following fields:
2020
* `lon` - Vector containing the longitude points for the Land-Sea Dataset
2121
* `lat` - Vector containing the latitude points for the Land-Sea Dataset
22-
* `lsm` - Vector or Array containing data regarding the Land-Sea Mask. 1 is Land, 0 is Ocean, NaN is outside the bounds of the GeoRegion
22+
* `lsm` - Vector or Matrix containing data regarding the Land-Sea Mask. 1 is Land, 0 is Ocean, NaN is outside the bounds of the GeoRegion.
2323
2424
!!! info
25-
If `lsm` is a vector, then `lon`, `lat` and `lsm` all must have the same length
25+
If `lsm` is a vector, then `lon`, `lat` and `lsm` all must have the same length. Otherwise if `lsm` is a matrix, then its first and second dimensions are longitude and latitude respectively, and it must have size `length(lon)` and `length(lat)`.
2626
"""
2727
abstract type LandSeaData end
2828

@@ -34,8 +34,17 @@ A LandSea Dataset that also contains information on the topographic height.
3434
A `LandSeaTopo` type will also contain the following field:
3535
* `z` - Vector or Array containing data regarding the Orographic Height in meters. NaN is outside the bounds of the GeoRegion
3636
37+
A `LandSeaTopo` type can be created using the function:
38+
39+
LandSeaTopo(
40+
lon :: Vector{FT1},
41+
lat :: Vector{FT1},
42+
lsm :: Union{Vector{FT2},Matrix{FT2}},
43+
z :: Union{Vector{FT2},Matrix{FT2}}
44+
) where {FT1 <: Real, FT2 <: Real} -> LandSeaTopo
45+
3746
!!! info
38-
If `z` or `lsm` are vectors, then `lon`, `lat`, `lsm` and `z` all must be vectors of the same length
47+
`z` and `lsm` must both be either (1) vectors or (2) matrices of the same size. If `lsm` and `z` are vectors, then `lon`, `lat`, `lsm` and `z` all must have the same length. Otherwise if `lsm` and `z` are matrices, then their first and second dimensions are longitude and latitude respectively, and they are of size `length(lon)` and `length(lat)`.
3948
"""
4049
struct LandSeaTopo{FT1<:Real,FT2<:Real} <: LandSeaData
4150

@@ -94,6 +103,14 @@ end
94103
LandSeaFlat <: LandSeaData
95104
96105
A LandSea Dataset that contains only information on the land-sea mask and no topography.
106+
107+
A `LandSeaFlat` type can be created using the function:
108+
109+
LandSeaFlat(
110+
lon :: Vector{FT1},
111+
lat :: Vector{FT1},
112+
lsm :: Union{Vector{FT2},Matrix{FT2}}
113+
) where {FT1 <: Real, FT2 <: Real} -> LandSeaTopo
97114
"""
98115
struct LandSeaFlat{FT1<:Real,FT2<:Real} <: LandSeaData
99116

@@ -129,6 +146,16 @@ modulelog() = "$(now()) - LandSea.jl"
129146
getLandSea
130147
131148
An extensible function type to retrieve LandSea Datasets. You can use this function name in your packages if you want to retrieve a specific LandSea dataset.
149+
150+
getLandSea(
151+
ids :: <Dataset Type of Interest>,
152+
geo :: GeoRegion
153+
) -> LandSeaData
154+
155+
Arguments
156+
=========
157+
- `ids` : A `struct` type for the dataset of interest (e.g., a [`NASAPrecipitationDataset`](https://georegionsecosystem.github.io/NASAPrecipitation.jl/stable/datasets/intro))
158+
- `geo` : A `GeoRegion` structure type
132159
"""
133160
function getLandSea end
134161

0 commit comments

Comments
 (0)