Skip to content

GETASSE-30 DEM

Reader Interface

GETASSE30 DEM reader.

GETASSE30 ("Global Earth Topography And Sea Surface Elevation at 30 arc seconds") is organised as 15deg x 15deg tiles. Each tile is a 1800 x 1800 grid of big-endian signed 16-bit integers (metres, referenced to the WGS84 ellipsoid). The tile file name encodes the latitude/longitude of the centre of its most south-west pixel, e.g. 45S045W.GETASSE30.

See https://step.esa.int/main/wp-content/help/versions/9.0.0/snap/org.esa.snap.snap.help/desktop/GETASSE30ElevationModel.html

Attributes

Functions:

read_dem_tile

Python
read_dem_tile(tile_path: str | Path) -> xr.DataArray

Read GETASSE30 DEM data from a tile path.

Missing tiles raise a FileNotFoundError. Results are cached, so repeated reads of the same tile are cheap.

Parameters:

Name Type Description Default
tile_path str | Path

Path to the GETASSE30 tile.

required

Returns:

Type Description
DataArray

Altitude DEM data with latitude and longitude axes (int16, metres).

get_dem_altitudes

Python
get_dem_altitudes(coords: NDArray[floating], dem: str | Path) -> float | npt.NDArray[np.floating]

Retrieve altitude from GETASSE30 DEM at given coordinate(s).

Points are grouped by the set of tiles they require, so each tile (or tile mosaic) is built once and queried with a single vectorised interpolation.

Parameters:

Name Type Description Default
coords NDArray[floating]

Geographic coordinates as latitude/longitude in decimal degrees. Shape (2,) for a single point or (N, 2) for multiple points. Each row is [latitude, longitude], with latitude in [-90, 90] and longitude in [-180, 180].

required
dem str | Path

Path to the GETASSE30 DEM folder.

required

Returns:

Type Description
float | NDArray[floating]

Interpolated altitude(s) in metres relative to the WGS84 ellipsoid. A float for a single (2,) input, or an array of shape (N,).

get_dem_roi

Python
get_dem_roi(lat_start_deg: float, lon_start_deg: float, lat_size_deg: float, lon_size_deg: float, dem: str | Path) -> xr.DataArray

Extract GETASSE30 DEM elevation data interpolated over a rectangular area.

Parameters:

Name Type Description Default
lat_start_deg float

Latitude of the bottom-left corner of the ROI [deg].

required
lon_start_deg float

Longitude of the bottom-left corner of the ROI [deg].

required
lat_size_deg float

Latitudinal extent of the ROI [deg]. Must be greater than 30 arcsec (i.e. > 30/3600 deg).

required
lon_size_deg float

Longitudinal extent of the ROI [deg]. Must be greater than 30 arcsec (i.e. > 30/3600 deg).

required
dem str | Path

Path to the GETASSE30 DEM folder.

required

Returns:

Type Description
DataArray

2D array of elevation values (metres) with lat and lon dimensions. The axes start at lat_start_deg / lon_start_deg and are sampled every 30 arcsec; the final sample is one step short of start + size (the stop value is excluded).

get_dem_polygon

Python
get_dem_polygon(polygon: Polygon, dem: str | Path) -> xr.DataArray

Extract GETASSE30 DEM elevation data over a polygon area.

DEM data is returned as-is (no interpolation), covering the bounding box of the polygon's convex hull.

Note

GETASSE30 has a native resolution of 30 arc seconds.

Warning

A region that crosses the antimeridian must be expressed with unwrapped longitudes, extending past 180deg (e.g. use polygon=shapely.box(179, 34, 181, 36) to represent a 2deg x 2deg box crossing the antimeridian).

Parameters:

Name Type Description Default
polygon Polygon

Area of interest. The DEM is extracted over the bounding box of this polygon's convex hull.

required
dem str | Path

Path to the GETASSE30 DEM folder.

required

Returns:

Type Description
DataArray

2D array of elevation values (metres) with lat and lon dimensions, covering the bounding box of polygon.

Utilities

Utilities for GETASSE30 DEM reader.

Attributes

LAT_BOUNDARIES_DEG module-attribute

Python
LAT_BOUNDARIES_DEG = (-90, 90)

LON_BOUNDARIES_DEG module-attribute

Python
LON_BOUNDARIES_DEG = (-180, 180)

MAX_TILE_LAT module-attribute

Python
MAX_TILE_LAT = 75

MIN_TILE_LAT module-attribute

Python
MIN_TILE_LAT = -90

MAX_TILE_LON module-attribute

Python
MAX_TILE_LON = 165

MIN_TILE_LON module-attribute

Python
MIN_TILE_LON = -180

TILE_SIZE_DEG module-attribute

Python
TILE_SIZE_DEG = 15

TILE_EXTENSION module-attribute

Python
TILE_EXTENSION = '.GETASSE30'

DEM_STEP_ARCSEC module-attribute

Python
DEM_STEP_ARCSEC = 30

DEM_RESOLUTION_DEG module-attribute

Python
DEM_RESOLUTION_DEG = 30 / 3600

HALF_RES_DEG module-attribute

Python
HALF_RES_DEG = DEM_RESOLUTION_DEG / 2

DEM_TILE_SIZE module-attribute

Python
DEM_TILE_SIZE = 1800

Functions:

raise_on_invalid_lat

Python
raise_on_invalid_lat(lat: float | NDArray[floating]) -> None

Validate that latitude values fall within bounds

raise_on_invalid_lon

Python
raise_on_invalid_lon(lon: float | NDArray[floating]) -> None

Validate that longitude values fall within bounds

lat_lon_to_tile

Python
lat_lon_to_tile(coords: NDArray[floating]) -> list[list[str]]

GETASSE30 DEM tile name lookup with edge detection.

Returns the tile(s) containing each coordinate. If a point falls on an edge pixel of a tile (within half a pixel of a tile boundary), the neighboring tile(s) are also returned so interpolation can cross tile boundaries. The antimeridian is handled as periodic; the poles clamp to a single tile.

Parameters:

Name Type Description Default
coords NDArray[floating]

Coordinates in degrees, either a single point of shape (2,) as [latitude, longitude], or multiple points of shape (N, 2) where each row is [latitude, longitude].

required

Returns:

Type Description
list[list[str]]

One list of tile names per input point (1, 2, or 4 names depending on whether the point is interior, on an edge, or on a corner).

generate_tile_name

Python
generate_tile_name(lat: int, lon: int) -> str

Generate a GETASSE30 DEM tile name given its origin latitude and longitude.

parse_tile_origin

Python
parse_tile_origin(tile_name: str) -> tuple[int, int]

Return (latitude_origin, longitude_origin) parsed from a tile file name.

bbox_tile_origins

Python
bbox_tile_origins(min_lat: float, min_lon: float, max_lat: float, max_lon: float) -> tuple[list[int], list[int], list[int]]

Tile origins covering a bounding box.

Returns (lat_origins, east_lon_origins, west_lon_origins). When the box crosses the antimeridian (max_lon > 180) the longitude origins are split into the eastern side ([start, 180)) and the wrapped western side (negative longitudes); otherwise west_lon_origins is empty.