easysnowdata.terrain.dem.load#
- easysnowdata.terrain.dem.load(aoi: Any = None, *, product: str | None = None, source: str | None = None, resolution: int | None = None, ellipsoidal: bool = False, items: Any = None, crs: Any = None, grid_resolution: float | None = None, chunks: Any = 'easysnowdata-default', mask: bool = True, resampling: str = 'bilinear', **kwargs: Any) DataArray[source]#
Load elevation for aoi from one of the DEM products.
- Parameters:
aoi – Any form
easysnowdata.aoi.parse_aoi()accepts.clip=Falseon anAOIreturns the covering tiles whole (STAC routes).product – Which DEM:
"copernicus-dem"(default),"nasadem","srtm","3dep","alos-dem"or"gedtm30". Short forms ("copernicus","alos","gedtm") work too; seeALIASES.source – Which route to that product: the product’s default when
None. Copernicus:"planetary-computer","earth-search"(unsigned AWS, no account),"opentopography"(the 2023_1 release, no account) or"gee"(the 2024_1 release). NASADEM and ALOS:"planetary-computer","opentopography"or"gee". 3DEP:"planetary-computer"or"gee". SRTM:"opentopography"(no account) or"gee". GEDTM30:"opentopography".resolution – The DEM product’s resolution in metres, not the output grid: Copernicus 30 or 90, 3DEP 10 or 30, the rest 30.
Nonepicks the product’s finest.ellipsoidal –
Truereads OpenTopography’s WGS84-ellipsoid copy of SRTM GL1 or ALOS World 3D instead of the EGM96 orthometric heights, for differencing against ICESat-2, GNSS or lidar heights. Onlyproduct="srtm"and"alos-dem"onsource="opentopography"have one (SRTM’s default source already is); anything else raises.items – Tiles from
search()(a GeoDataFrame orItemCollection); when given, no search is made. STAC routes only.crs – Output grid.
crs="utm"reprojects to the AOI’s UTM zone; the native grid is kept when both areNone.grid_resolution – Output grid.
crs="utm"reprojects to the AOI’s UTM zone; the native grid is kept when both areNone.chunks – Dask chunks; the default is the source’s native chunking and
Noneloads eagerly.mask –
True(default, §2.5 for continuous products) replaces the nodata sentinel with NaN and keeps it asrio.encoded_nodata;Falsekeeps the sentinel withrio.nodataset. Earth Engine routes already return NaN outside the asset.resampling – How pixels are interpolated when crs or grid_resolution puts the DEM on a new grid:
"bilinear"(default) or"cubic"for a continuous field like elevation;"nearest"only reproduces the blocky staircase of the source pixels. Both the STAC and the Earth Engine routes use the same method, so two copies of one DEM land on a common grid identically. Ignored on the native grid.**kwargs – Passed to
odc.stac.load(STAC routes) orxarray.open_dataset(engine="ee")(Earth Engine routes).
- Returns:
xarray.DataArray–elevationin metres, dimslatitude/longitude(ory/xwhen the grid is projected), lazy unlesschunks=None, withvertical_datum,resolution_mand the usual provenance attrs.
Examples using easysnowdata.terrain.dem.load#
Glacier outlines: Randolph Glacier Inventory 7.0 and 6.0
Digital elevation models: Copernicus, NASADEM, SRTM, 3DEP, ALOS, GEDTM30