slv.measurements.mobile.location.classify_location#
- slv.measurements.mobile.location.classify_location(feat, moving_speed=2.0, moving_speed_est=1.5, line_distance=50.0, scatter_m=1.0, low_nsat=6, yard_buffer=30.0, near_yard_m=300.0, off_track_m=100.0, smooth_min=15, use_footprint=False)[source]#
Classify each row of
location_features()into one ofSTATES.Rules, per minute:
no fixes →
unknownmoving (
speed_max >= moving_speed, or where no speed was recordedspeed_est >= moving_speed_est) on a track (d_track < line_distance):lineif withinnear_yard_mof a storage polygon, elseroute; moving off-track inside the yard buffer →yard.stationary near the yard: degraded fix (
scatter > scatter_mornsat <= low_nsat, majority-voted oversmooth_minminutes) →depot; withuse_footprinta clean fix whose median sits inside the depot footprint is alsodepot. Off by default: the yard loop runs through the padded footprint, so it mislabels clean yard nights (e.g. 2025-02-16). Otherwiseyard.stationary elsewhere →
stopped.overrides to
unknown:d_track > off_track_m(unless inside the yard buffer), or withinnear_yard_mof the storage polygon while neither on the line nor inside the yard buffer.
Returns a frame with
state(categorical),indoor(nullable boolean: depot → True, other located states → False, unknown → NA),yard_name(copied fromfeatif present),degraded(raw per-minute flag),degraded_smoothand, when battery voltage is present,powered(volt_min >= POWER_OFF_V).- Return type: