slv.measurements.mobile#

Mobile-platform measurements: the TRAX light-rail trains and the Wyoming mobile lab.

Submodules, one concern each:

  • network — TRAX lines, staged points, storage yards (JRRSC, MRSC), shed footprints, route-buffer filter.

  • gps — GPS readers (lin-group air-trend, horel-group CR1000 logger, era-based read_trax_gps()) and merge_with_gps().

  • location — per-minute location classifier: indoor (shed) vs outdoor (yard / pass-by / route / stopped), state / indoor / yard_name.

  • calibration — cal_source provenance and the uncalibrated windows.

  • obs — build_trax_obs() / load_trax_obs(), the cached CH4 record with both tag sets and a load-time location filter.

  • transects — transect matrices obs[transect, point]: the network builder (build_network_transects() / build_trax_transects() / load_network_transects()) and the archived per-line matrices (load_transects()).

  • receptors — STILT receptors: 50-m network points, 2-km segment crossings, one PYSTILT multipoint receptor per crossing, and dwell (parked-train) receptors.

  • receptor_obs — the CH4 observation for each of those receptors, keyed (obs_location, obs_time) exactly as the inversion joins them to the footprints.

  • wyoming — the Wyoming mobile lab (Aeris + met readers, enhancement ratios, wind-barb map); not re-exported, import from the module.

Every public function and table is re-exported here, so from slv.measurements.mobile import X works for all of them; the classifier thresholds (location) and GPS column/flag constants (gps) stay in their modules.

Exported from submodules

apply_dropout_rule

Drop rows within window_min minutes of a CH4 laser dropout.

apply_epoch_offset

Subtract the analyzer-epoch offset from CH4_ppm (no-op when apply is False).

apply_low_pressure_rule

Keep rows flagged −63 whose Cavity_P_torr lies inside band, and tag every row whose cavity pressure is low.

apply_pressure_rule

Drop sources rows whose cavity pressure is outside band (see PRESSURE_BAND).

apply_slope_guard

Set CH4 to NaN where CH4d_m differs from the same UTC day's median slope by more than tol (fraction).

assign_lines

The line letter each sample is on, resolved from the points around it in time.

build_dwell_receptors

PYSTILT receptor table (RECEPTOR_COLUMNS) for the dwell periods.

build_trax_obs

Build the georeferenced TRAX CH4 record from the pipeline levels.

build_trax_receptors

PYSTILT receptor table (RECEPTOR_COLUMNS) from a crossings table.

build_network_transects

Build the [transect, point] matrix of one obs frame on the network points.

build_trax_transects

Build and write the network matrices, one NetCDF per calendar year.

classify_location

Classify each row of location_features() into one of STATES.

clock_checked_days

Days whose Pi clock can be trusted to max_clock_offset_s.

dropout_times

Times of atmosphere rows whose unvalidated CH4 is below threshold — laser dropouts.

epoch_offset_column

The epoch offset (ppm) in force at each time, 0.0 outside every epoch.

fill_gps_gaps_with_horel

Georeference the rows the lin GPS could not, using the horel logger's 5-s fixes.

filter_cal_source

Drop the uncalibrated rows when include_uncalibrated is False.

filter_location

Keep rows whose state is in location (a LOCATION_SETS name or a tuple of states).

filter_near_routes

Keep GPS points within buffer (in routes' CRS units) of any route.

filter_receptor_hours

Keep rows whose time falls in those local-time hours (None keeps all).

find_dwells

Periods where the train stayed put: parked on a yard track or waiting at a terminus.

find_segment_crossings

Split the GPS record into crossings of the 2-km segments.

get_geodf

Resolve a geometry argument: a GeoDataFrame, a path or packaged file to read, or False / None for no geometry (returns None).

inlet_lag_seconds

Inlet lag in seconds at each of times, and where it came from.

label_dwell_site

Where each dwell is: yard_name (JRRSC / MRSC, from the packaged storage polygons) and segment (nearest 2-km segment, NaN beyond max_dist).

label_observations

Per-observation state from the per-minute table (time floored to the minute).

label_trax_location

Add state, indoor and yard_name to a georeferenced TRAX obs frame.

lin_clock_offset_by_day

Median GPS-minus-Pi clock offset (s) per UTC day, from a lin GPS frame.

load_depot_footprint

Packaged shed footprints at the service centers (trax_depots.geojson).

load_storage_polygons

All storage yards in storage_locations, one row each with a name.

load_network_transects

The network transect matrices of years (all on disk by default), concatenated along transect with a fresh 0..N-1 index.

load_transects

Concatenate the archived transect matrices for one TRAX line into an xarray Dataset.

load_trax_epoch_offsets

Analyzer-epoch offsets of the uncalibrated (manual-cal) era, ppm.

load_trax_fixes

Time_UTC, Latitude_deg, Longitude_deg of the location rows of the cached TRAX record (obs.parquet), one row per distinct second, time-sorted.

load_trax_lines

The TRAX lines (UTA_TRAX.geojson under $LINGROUP_DATA_DIR), one row per line with its letter in line.

load_trax_network_points

The 50-m network points with their 2-km segment membership.

load_trax_obs

Load the cached TRAX CH4 record ($SLV_USER_DATA_DIR/trax/obs.parquet), building it if needed.

load_trax_points

Points every spacing m along the TRAX lines, with the lines they serve.

load_trax_uncalibrated_windows

Windows where the LGR ran without a valid reference tank but the raw data are good.

location_features

Per-freq GPS features that the classifier needs (plus power, if available).

merge_with_gps

Attach GPS positions to a mobile site's concentration records.

read_horel_cr1000

Horel-group CR1000 logger record (5 s): GPS + battery voltage + roof T/RH.

read_lin_gps

Lin-group (air-trend) GPS at 1 s from the pipeline qaqc level, Dec 2014 on.

read_trax_gps

Best GPS source for classifying, by era: lin-group GPS before HOREL_POST_PILOT, horel logger (with battery/T/RH) after.

recover_hot_rows

Calibrate the rows the pipeline flagged -64 (cavity T outside 5-45 C) itself.

release_points

Index of the segment's points on every line in lines (all of them if lines is empty).

select_uncalibrated

Rows of a qaqc-level LGR frame that fall inside the uncalibrated windows.

state_intervals

Run-length table of a per-minute state series: start, end, state, minutes.

trax_receptor_observations

One CH4 observation per STILT receptor, keyed for the inversion.

Modules

calibration

Calibration provenance of the TRAX CH4 record: cal_source tags and the windows where the analyzer ran without a reference tank but its raw data are usable.

gps

GPS records for the mobile platforms and the observation/GPS merge.

location

Where is the TRAX train, minute by minute: indoor (shed), yard, pass-by, route, stopped?

network

The TRAX network and its yards: line geometry, staged points, storage polygons, shed footprints, and the route-buffer filter used by the GPS merge.

obs

The georeferenced TRAX CH4 observation record: build it from the pipeline levels, tag every row with calibration provenance and location, cache it, and load it with a location filter.

receptor_obs

TRAX CH4 observations paired one-to-one with the STILT receptors.

receptors

STILT receptors for the TRAX record: one multipoint receptor per 2-km segment crossing.

transects

TRAX transect matrices: obs[transect, point] over the 50-m network points.

wyoming

Wyoming mobile lab: Aeris CH4/C2H6 and vehicle met readers, enhancements and C2/C1 ratios, and a wind-barb map of a drive.