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=False on an AOI returns 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; see ALIASES.

  • 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. None picks the product’s finest.

  • ellipsoidal – True reads 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. Only product="srtm" and "alos-dem" on source="opentopography" have one (SRTM’s default source already is); anything else raises.

  • items – Tiles from search() (a GeoDataFrame or ItemCollection); 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 are None.

  • grid_resolution – Output grid. crs="utm" reprojects to the AOI’s UTM zone; the native grid is kept when both are None.

  • chunks – Dask chunks; the default is the source’s native chunking and None loads eagerly.

  • mask – True (default, §2.5 for continuous products) replaces the nodata sentinel with NaN and keeps it as rio.encoded_nodata; False keeps the sentinel with rio.nodata set. 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) or xarray.open_dataset(engine="ee") (Earth Engine routes).

Returns:

xarray.DataArray – elevation in metres, dims latitude/longitude (or y/x when the grid is projected), lazy unless chunks=None, with vertical_datum, resolution_m and the usual provenance attrs.

Examples using easysnowdata.terrain.dem.load#

Glacier outlines: Randolph Glacier Inventory 7.0 and 6.0

Glacier outlines: Randolph Glacier Inventory 7.0 and 6.0

Forest cover fraction (CGLS-LC100)

Forest cover fraction (CGLS-LC100)

Digital elevation models: Copernicus, NASADEM, SRTM, 3DEP, ALOS, GEDTM30

Digital elevation models: Copernicus, NASADEM, SRTM, 3DEP, ALOS, GEDTM30