1 dem

dem

1.1 Classes

Name Description
CopernicusDEM Copernicus digital elevation model, 90m or 30m, with functions
DEM Factory class that wraps the available DEM (Digital Elevation Model) processors.
GTOPO30 GTOPO30 digital elevation model
ZeroAltitude Bypasses DEM, by setting all altitudes to zero

1.1.1 CopernicusDEM

dem.CopernicusDEM(
    l1=None,
    lat=None,
    lon=None,
    directory=None,
    resolution=90,
    missing=0,
    verbose=True,
)

Copernicus digital elevation model, 90m or 30m, with functions to get the altitude for a lat-lon grid and to download on demand DEM tiles via internet.

Uses per-pixel tile lookup: for each (lat, lon) point, determines which 1° tile covers that point, downloads the tile on demand, and indexes into it using the tile’s actual dimensions.

The DEM is a grid of tie points, not of pixels. The altitude is given for the degree line. There are 1200 rows per degree. The number of columns depends on the latitude band (fewer columns at higher latitudes, each spanning wider longitude).

1.1.1.1 Args:

l1: optional Xarray Dataset from an eoread reader (used to extract lat/lon bounds) lat: optional tuple (min, max) latitude bounds for pre-downloading tiles lon: optional tuple (min, max) longitude bounds for pre-downloading tiles directory: directory for tile storage resolution: 90 or 30, default 90 missing: value to use for missing (ocean) elevation data (default: 0) verbose: with trace output

1.1.2 DEM

dem.DEM()

Factory class that wraps the available DEM (Digital Elevation Model) processors.

Creates the appropriate DEM BlockProcessor based on the source parameter:

  • "zero"ZeroAltitude (all altitudes set to 0)
  • "gtopo30"GTOPO30 (30 arc-second global DEM, ~1km resolution)
  • "copernicus"CopernicusDEM (90m or 30m Copernicus DEM)

1.1.2.1 Args:

ds : xr.Dataset, optional Level-1 dataset (used to extract lat/lon bounds for DEM loading). Required for "gtopo30" and "copernicus" unless lat/lon are provided. source : str, default "zero" Which DEM source to use: "zero", "gtopo30", or "copernicus". **kwargs : Additional keyword arguments passed to the DEM constructor:

- For `GTOPO30`: `lat`, `lon`, `directory`, `missing`, `method`, `verbose`
- For `CopernicusDEM`: `lat`, `lon`, `directory`, `resolution`, `missing`, `verbose`

1.1.2.2 Returns:

BlockProcessor An instance of the selected DEM processor class.

1.1.2.3 Examples:

dem = DEM(ds, source=“copernicus”, resolution=30) result = dem.map_blocks(ds)

1.1.3 GTOPO30

dem.GTOPO30(
    l1=None,
    lat=None,
    lon=None,
    directory=None,
    missing=0,
    method='linear',
    verbose=True,
)

GTOPO30 digital elevation model

30 arc-second (~1km) - Between 56S and 60N

1.1.3.1 Args:

l1: Xarray Dataset for an eoread reader lat: tuple of (min, max) latitude bounds lon: tuple of (min, max) longitude bounds directory: directory for tile storage missing: value to use for missing elevation data (default: 0) method: interpolation method, ‘nearest’ or ‘linear’ (default: ‘linear’)

1.1.4 ZeroAltitude

dem.ZeroAltitude()

Bypasses DEM, by setting all altitudes to zero