Skip to main content

Module terrain

Module terrain 

Source
Expand description

Diagnostic mass-consistent terrain wind (NOABL/CONMESS-style).

A terrain height grid (in metres) plus a background WindField and optional surface wind monitors become a terrain-adjusted field: each fixed above-ground level is adjusted independently to satisfy 2-D horizontal mass conservation (div(u) = 0 with u = u0 − ∇φ), so flow is deflected over and around terrain. This is the cheap diagnostic tier of terrain flow, not a full CFD solve. Entirely offline and deterministic.

Structs§

GeoTransform
The georeferencing parsed from a GeoTIFF’s model tags.
HeightGrid
Terrain heights on an axis-aligned, uniform grid in metres. Row-major, south-to-north: heights[i * ncols + j] is column j (east) of row i, where row 0 is the southernmost row and i increases northward, matching the frame’s +z = north convention shared by monitors and local_en_m. origin_y is the south edge; sampling height_at moves north as z increases. Position y is up; the grid lies in the x–z plane.
Monitor
One surface wind observation, in the terrain grid’s frame (metres).
TerrainFlowField
A diagnostic terrain-adjusted wind field.

Enums§

SrtmResolution
A 1°×1° SRTM tile: 1201² samples for SRTM-3 (3 arc-sec ≈ 90 m), 3601² for SRTM-1 (1 arc-sec ≈ 30 m). .hgt files are 16-bit big-endian signed metres, recorded north→south (top row is the northern edge), west→east, sample values at the tile’s corners (not centres).

Functions§

from_flt
Load an ESRI binary floating-point raster (.flt raw float32 + .hdr sidecar header). Both the row order (north-first, “English reading order”) and the lower-left-corner origin are handled the same way as HeightGrid::from_ascii.
hgt_grid
Load an SRTM .hgt tile into a HeightGrid on a local equirectangular projection (metres), with (north_lat, west_lon) as the tile’s corner and the given point mapping to the frame origin.
local_en_m
Local equirectangular projection: (east, north) metres from the reference point, for the small domains a wind network covers. Not for continental scales.
monitors_from_geo_csv
Parse a monitor file of one reading per line: latitude,longitude,speed_ms,direction_compass_from_deg, # comments and a header line are skipped. Coordinates are projected via local_en_m and directions rotated into the frame.