slv.measurements.mobile.transects.build_network_transects#

slv.measurements.mobile.transects.build_network_transects(obs, points, lag=None, max_point_dist=60.0, max_gap='10min', reversal_m=500.0, min_span_m=1000.0, max_dwell_s=180.0, species='CH4_ppm', return_samples=False)[source]#

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

Parameters:
  • obs (DataFrame) – Georeferenced samples with Time_UTC, Longitude_deg, Latitude_deg and the species column (obs.parquet rows; cal_source and low_pressure are summarised per transit when present). Any order; sorted here.

  • points (GeoDataFrame) – load_trax_network_points() (any CRS; needs point, lines, segment and the s_<line> columns).

  • lag (float | DataFrame | None) – Inlet lag: None, seconds, or the per-epoch table with start/end/lag_s (inlet_lag_seconds()).

  • max_point_dist (float) – Snap radius to a network point [m]; farther samples are off-network.

  • max_gap (str | Timedelta) – A transit (and a run for the line assignment and lag) ends at a longer gap.

  • reversal_m (float) – lair.transects.split_transits(): turning-point prominence that ends a transit, and the shortest along-route span kept.

  • min_span_m (float) – lair.transects.split_transits(): turning-point prominence that ends a transit, and the shortest along-route span kept.

  • max_dwell_s (float | None) – lair.transects.transect_matrix(): samples at a point later than this after the transit first reached it are dropped (terminus dwells).

  • return_samples (bool) – Also return the per-sample assignment (Time_UTC, x, y lagged UTM position, point (-1 off-network), line ("" unresolved), transit (-1 not in a kept transit)), for diagnostics.

Returns:

dims transect x point; variables obs (ppm), time (mean POSIX s of the samples in the cell) and n (samples); point coords point (network id), lon, lat, lines, segment, s_<line>; transect coords line, direction (+1 with increasing s), heading (compass letter of travel), t_start, t_end, s_min, s_max, n_fix, n_points (points with data), coverage ((s_max - s_min) over that line’s full known extent – a short turn or a partial run reads well below 1; see the module docstring), lag_s, lag_source, and frac_uncalibrated / frac_low_pressure when the tags are present. Attributes record every parameter.

Return type:

xarray.Dataset