Skip to content

Commit

Permalink
dataset info land cover
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang committed Sep 12, 2023
1 parent d59b018 commit ad9183a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ To download the following datasets, users need access to CDS via cdsapi:
- ERA5
- ERA5 land
- LAI
- land cover

First, you need to be a registered user on *CDS* via the [registration page](https://cds.climate.copernicus.eu/user/register?destination=%2F%23!%2Fhome).

Expand Down
5 changes: 5 additions & 0 deletions docs/available_datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ You can add these yourself by creating a pull request, or open an issue to reque
Note: model level is set to "60" and all steps are included for downloading.

For more information, see [their webpage](https://ads.atmosphere.copernicus.eu/cdsapp#!/dataset/cams-global-ghg-reanalysis-egg4).

=== "Land cover classification gridded maps"
- `land_cover`

For more information, see [their webpage](https://cds.climate.copernicus.eu/cdsapp#!/dataset/satellite-land-cover).
2 changes: 2 additions & 0 deletions src/zampy/datasets/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from zampy.datasets.era5 import ERA5
from zampy.datasets.era5 import ERA5Land
from zampy.datasets.eth_canopy_height import EthCanopyHeight
from zampy.datasets.land_cover import LandCover
from zampy.datasets.prism_dem import PrismDEM30
from zampy.datasets.prism_dem import PrismDEM90

Expand All @@ -17,4 +18,5 @@
"eth_canopy_height": EthCanopyHeight,
"prism_dem_30": PrismDEM30,
"prism_dem_90": PrismDEM90,
"land_cover": LandCover,
}
45 changes: 45 additions & 0 deletions src/zampy/datasets/land_cover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""Land cover classification dataset."""

import numpy as np
from zampy.datasets.dataset_protocol import SpatialBounds
from zampy.datasets.dataset_protocol import TimeBounds
from zampy.datasets.dataset_protocol import Variable
from zampy.reference.variables import VARIABLE_REFERENCE_LOOKUP
from zampy.reference.variables import unit_registry


## Ignore missing class/method docstrings: they are implemented in the Dataset class.
# ruff: noqa: D102


class LandCover: # noqa: D101
"""Land cover classification gridded maps."""
name = "land-cover"
time_bounds = TimeBounds(np.datetime64("1992-01-01"), np.datetime64("2020-12-31"))
spatial_bounds = SpatialBounds(90, 180, -90, -180)
crs = "EPSG:4326"

raw_variables = [
Variable(name="lccs_class", unit=unit_registry.dimensionless),
]
variable_names = ["land_cover"]
variables = [VARIABLE_REFERENCE_LOOKUP[var] for var in variable_names]

license = "ESA CCI licence; licence-to-use-copernicus-products; VITO licence"

bib = """
@article{buchhorn2020copernicus,
title={Copernicus global land cover layers—collection 2},
author={Buchhorn, Marcel and Lesiv, Myroslava and Tsendbazar, Nandin-Erdene and Herold, Martin and Bertels, Luc and Smets, Bruno},
journal={Remote Sensing},
volume={12},
number={6},
pages={1044},
year={2020},
publisher={MDPI}
}
"""

data_url = "https://cds.climate.copernicus.eu/cdsapp#!/dataset/satellite-land-cover?tab=overview"

cds_dataset = "satellite-land-cover"
2 changes: 2 additions & 0 deletions src/zampy/reference/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def unit_registration() -> UnitRegistry:
"kilogram_per_square_meter_second = kilogram/(meter**2*second)"
)
unit_registry.define("milimeter_per_second = watt/meter**2")
unit_registry.define("dimensionless = []")
return unit_registry


Expand Down Expand Up @@ -53,6 +54,7 @@ def unit_registration() -> UnitRegistry:
Variable("latitude", unit=unit_registry.degree_north),
Variable("longitude", unit=unit_registry.degree_east),
Variable("elevation", unit=unit_registry.meter),
Variable("land_cover", unit=unit_registry.dimensionless),
)

VARIABLE_REFERENCE_LOOKUP = {var.name: var for var in VARIABLE_REFERENCE}

0 comments on commit ad9183a

Please sign in to comment.