suboptimumg.log_analysis.preprocess_gps#
- suboptimumg.log_analysis.preprocess_gps.clean_gps_xy(x_m, y_m, max_jump_m=30.0, max_radius_m=1500.0)[source]#
Remove outliers from projected GPS coordinates. Applies radius filter first to drop points further than max_radius_m from the median position, then applies jump filter to drop points that are large jumps (> max_jump_m) from the previous kept point.
- Parameters:
x_m (NDArray[float64]) – East coordinates in meters
y_m (NDArray[float64]) – North coordinates in meters
max_jump_m (float) – Maximum allowed step distance between consecutive points (meters).
max_radius_m (float) – Maximum allowed distance from the median position (meters).
- Returns:
NDArray[float64] – Cleaned x_m
NDArray[float64] – Cleaned y_m
NDArray[bool_] – Boolean mask, true where a point was kept.
- Return type:
Tuple[ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[bool]]]
- suboptimumg.log_analysis.preprocess_gps.gps_to_local_xy(latitudes, longitudes, origin=None)[source]#
Equirectangular projection from lat/lon to local East/North coordinates (meters).
- Parameters:
latitudes (NDArray[float64]) – Array of latitude values in degrees (y/North)
longitudes (NDArray[float64]) – Array of longitude values in degrees (x/East)
origin ((lat_deg, lon_deg) or None) – Reference point for projection. If None, uses the median position.
- Returns:
NDArray[float64] – x_m - East coordinates in meters (same axis as longitude/x)
NDArray[float64] – y_m - North coordinates in meters (same axis as latitude/y)
Tuple[float, float] – origin_latlon - The (lat, lon) reference point used for projection
- Return type:
Tuple[ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], Tuple[float, float]]
- suboptimumg.log_analysis.preprocess_gps.preprocess_gps_data_instances(data, ins_lat_col='pcm.vnav.posLla.latitude', ins_lon_col='pcm.vnav.posLla.longitude', fix_col='pcm.vnav.gpsFix')[source]#
Extract GPS position DataInstances and inject them into SingleRunData.
Filters invalid samples (no GPS fix, zero lat/lon pairs), projects to local East/North Cartesian coordinates, and stores the results as
gps.latitude,gps.longitude,posE, andposNindata.- Parameters:
data (SingleRunData)
ins_lat_col (str) – Key for the INS latitude signal.
ins_lon_col (str) – Key for the INS longitude signal.
fix_col (str or None) – Key for the GPS fix-status signal.
Noneskips the fix check.
- Returns:
The same
dataobject withgps.latitude,gps.longitude,posN, andposEadded.- Return type:
SingleRunData