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
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
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 |
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 |
get_dem_roi
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. |
required |
lon_size_deg
|
float
|
Longitudinal extent of the ROI [deg]. Must be greater than 30 arcsec
(i.e. |
required |
dem
|
str | Path
|
Path to the GETASSE30 DEM folder. |
required |
Returns:
| Type | Description |
|---|---|
DataArray
|
2D array of elevation values (metres) with |
get_dem_polygon
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 |
Utilities
Utilities for GETASSE30 DEM reader.
Attributes
Functions:
raise_on_invalid_lat
Validate that latitude values fall within bounds
raise_on_invalid_lon
Validate that longitude values fall within bounds
lat_lon_to_tile
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 |
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
Generate a GETASSE30 DEM tile name given its origin latitude and longitude.
parse_tile_origin
Return (latitude_origin, longitude_origin) parsed from a tile file name.
bbox_tile_origins
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.