1 water
water
Read global surface water from https://global-surface-water.appspot.com/
https://doi.org/10.1038/nature20584
1.1 Example:
gsw = GSW(agg=8) Create water mask mask = gsw.sel(latitude=lat, longitude=lon, method=‘nearest’) > 50
1.2 Classes
| Name | Description |
|---|---|
| GSW | Global surface water reader |
| GSWLandMask | BlockProcessor that adds GSW water occurrence data and raises a flag |
1.2.1 GSW
water.GSW(l1=None, lat=None, lon=None, directory=None, agg=8)Global surface water reader
1.2.1.1 Args:
lat: tuple of (min, max) latitude bounds lon: tuple of (min, max) longitude bounds directory: directory for tile storage agg: Factor of aggregation
1.2.1.2 Returns:
A xarray.DataArray of the water occurrence between 0 and 100
1.2.2 GSWLandMask
water.GSWLandMask(
l1=None,
lat=None,
lon=None,
directory=None,
agg=8,
threshold=50,
flag_var='flags',
flag_name='LAND',
flag_value=1,
)BlockProcessor that adds GSW water occurrence data and raises a flag where water occurrence is below threshold.
Arguments: l1: Level-1 dataset for cropping GSW data (passed to GSW) lat: latitude bounds tuple (passed to GSW) lon: longitude bounds tuple (passed to GSW) directory: directory for GSW tile storage (passed to GSW) agg: GSW aggregation factor (passed to GSW) threshold: water occurrence threshold in % (default: 50) flag_var: name of the flags variable to modify (default: “flags”) flag_name: name of the flag to raise (default: “LAND”) flag_value: bitmask value for the flag (default: 1)
1.3 Functions
| Name | Description |
|---|---|
| generate_full_gsw_mosaic | Build a lazy dask array representing the full global surface water mosaic |
| list_tiles | Return list of latlon acronym |
| read_tile | Read a single tile as a dask array |
1.3.1 generate_full_gsw_mosaic
water.generate_full_gsw_mosaic(directory, agg)Build a lazy dask array representing the full global surface water mosaic
1.3.2 list_tiles
water.list_tiles()Return list of latlon acronym
1.3.3 read_tile
water.read_tile(tile_name, agg, directory)Read a single tile as a dask array
Data is accessed on demand