2.29.3.3. pycsamt.topo.extract#
Extract elevation and chainage arrays from Sites / EDI collections.
These utilities are the bridge between pycsamt’s data model and the
topography rendering pipeline. They operate on any object that contains
EDI-like items with HEAD lat/lon/elev attributes — including
Sites, plain lists of
EDIFile, and
EDIBatch objects.
Examples
>>> from pycsamt.topo.extract import extract_elevation, extract_chainage
>>> elev = extract_elevation(sites) # (n_stations,) m a.s.l.
>>> chain = extract_chainage(sites) # (n_stations,) km
Functions
|
Compute along-profile cumulative distance (km) for each station. |
|
Extract per-station elevation (m a.s.l.) from a Sites or EDI collection. |
|
Return station name / ID strings in collection order. |
|
Return True if any station carries a meaningful non-zero elevation. |
- pycsamt.topo.extract.extract_elevation(sites)[source]
Extract per-station elevation (m a.s.l.) from a Sites or EDI collection.
Reads the
.elev(or.elevation/.alt) field from each station’s HEAD coordinate block. Returns a zero array and emits aUserWarningwhen no valid non-zero elevation is found.
- pycsamt.topo.extract.extract_chainage(sites)[source]
Compute along-profile cumulative distance (km) for each station.
Uses a flat-Earth approximation: cumulative Euclidean distance in lat/lon space scaled to metres, converted to km. Stations are assumed to be in profile order.
- Parameters:
- Returns:
Cumulative chainage in km from the first station (starts at 0).
- Return type:
- pycsamt.topo.extract.has_elevation(sites)[source]
Return True if any station carries a meaningful non-zero elevation.
- Parameters:
sites (any station container)
- Return type: