Terrain#
easysnowdata.terrain#
Terrain: digital elevation models and topographic indices.
Products#
demFive DEMs behind one
load: Copernicus DEM GLO-30/90 (the default), NASADEM, SRTM GL1, USGS 3DEP (10 m, US), and ALOS World 3D. Planetary Computer and Earth Search need no account; Earth Engine is an alternative route to each and the only one to SRTM proper.chiliCHILI, the continuous heat-insolation load index (Earth Engine).
hillshadeNatural Earth global shaded relief, a hillshade basemap at 1 or 2 arcmin in five styles (no account).
import easysnowdata as esd
aoi = (-121.94, 46.72, -121.54, 46.99)
esd.terrain.dem.load(aoi) # Copernicus GLO-30
esd.terrain.dem.load(aoi, product="3dep") # 10 m over the US
esd.terrain.dem.compare() # how the five differ
esd.terrain.chili.load(aoi)
esd.terrain.hillshade.load(aoi) # basemap shading
easysnowdata.terrain.chili#
CHILI — Continuous Heat-Insolation Load Index (§4.5).
import easysnowdata as esd
aoi = (-121.94, 46.72, -121.54, 46.99)
chili_da = esd.terrain.chili.load(aoi) # native 0-255 values
index_da = esd.terrain.chili.load(aoi, normalize="index") # the 0-1 index
CHILI is a topographic index of the combined effect of solar radiation and surface temperature computed from ALOS World 3D-30m (Theobald et al. 2015), served at ~90 m between 70°N and 70°S. The Earth Engine asset stores the 0-1 index scaled to 8 bits, so values come back on a 0-255 scale.
Unlike the pre-0.2 topography.get_chili this loader does not rescale by
default: min-max normalization inside the AOI made values depend on the box
that was requested, so the same pixel changed value with the window
(normalize="minmax" keeps that behaviour for one release).
Load CHILI for aoi from Earth Engine at the asset's native grid. |
easysnowdata.terrain.dem#
Digital elevation models: Copernicus DEM, NASADEM, SRTM, 3DEP, ALOS World 3D and GEDTM30.
Six DEMs, one load. Copernicus GLO-30 is the default because it is the
most recent global model with the fewest voids, but it is a choice, not the
only option, and the others differ in ways that matter for snow work: 3DEP is
10 m over the United States, NASADEM and SRTM are the year-2000 radar
surface that most older studies used, ALOS World 3D is the optical stereo
model CHILI is derived from, and GEDTM30 is a global bare-earth terrain
model (canopy and buildings removed), where every other global DEM here is a
surface model. PRODUCTS lists them and compare() says how they
differ:
import easysnowdata as esd
aoi = (-121.94, 46.72, -121.54, 46.99)
dem_da = esd.terrain.dem.load(aoi) # Copernicus GLO-30
dem_da = esd.terrain.dem.load(aoi, product="nasadem") # SRTM heritage, no account
dem_da = esd.terrain.dem.load(aoi, product="3dep", resolution=10) # US 10 m
dem_da = esd.terrain.dem.load(aoi, product="srtm") # SRTM GL1 v3 on Earth Engine
dem_da = esd.terrain.dem.load(aoi, source="earth-search") # the same GLO-30, unsigned AWS
dem_da = esd.terrain.dem.load(aoi, source="opentopography") # GLO-30 2023_1, no account
dem_da = esd.terrain.dem.load(aoi, product="gedtm30") # global bare-earth DTM
dem_da = esd.terrain.dem.load(aoi, product="srtm", ellipsoidal=True) # WGS84 ellipsoid heights
items_gdf = esd.terrain.dem.search(aoi, product="3dep") # the covering tiles
Every product returns elevation in metres with the same dims, CRS
handling and provenance attributes; the vertical datum is in
attrs["vertical_datum"] (EGM2008 for Copernicus and GEDTM30, EGM96 for
the SRTM family and ALOS, NAVD88 for 3DEP), which is the first thing to
reconcile before differencing two of them.
source="opentopography" reads OpenTopography’s static STAC catalog
(easysnowdata.providers.opentopography): public COGs, no account, for
Copernicus (the 2023_1 release), NASADEM, SRTM GL1, ALOS World 3D and
GEDTM30. It is the default for SRTM and GEDTM30 and an alternative for the
rest. It also carries OpenTopography’s WGS84-ellipsoid copies of SRTM GL1
and ALOS World 3D, which ellipsoidal=True selects: the heights to use
when differencing against ICESat-2, GNSS or airborne lidar, which are
referenced to the ellipsoid. OpenTopography made them from the orthometric
versions with the EGM96 geoid.
easysnowdata.terrain.hillshade#
Natural Earth global shaded relief — a hillshade basemap layer.
import easysnowdata as esd
aoi = (-123.0, 46.0, -120.5, 48.0)
hillshade_da = esd.terrain.hillshade.load(aoi) # 1:10m, gray earth
plain_da = esd.terrain.hillshade.load(aoi, style="shaded-relief")
world_da = esd.terrain.hillshade.load(scale="50m") # whole globe
The Natural Earth raster collection (Patterson & Kelso) ships global grayscale shaded relief in several styles, from a plain hillshade to the “Gray Earth” family that adds hypsometric tints, an ocean-bottom relief and drainages. They are 8-bit, one band, in geographic coordinates (EPSG:4326): 1 arcmin (~1.85 km) at the 1:10m scale and 2 arcmin at 1:50m. Brightness is a cartographic shading, not a physical quantity, so there is no nodata value and nothing is masked; use the layer under other data, not in analysis.
This is the layer download_and_preprocess_hillshade.ipynb in the global
snowmelt runoff onset project draws its maps on. That notebook reprojects it
to Robinson; this loader returns the native grid, because odc.reproject
onto whatever the map uses is one line (see the gallery example).
Each style is one zip on the Natural Earth S3 bucket (18-92 MB). It is
fetched once into the easysnowdata cache and read in place, which clips an
AOI in a few seconds; cache=False reads it over HTTPS every call instead,
which is only sensible for a one-off small AOI.
For a hillshade at DEM resolution, shade a DEM from dem
instead; this layer is for context maps from a basin up to the globe.
Load Natural Earth shaded relief for aoi (the globe when |