suboptimumg.plotting.gps_visualization#
- suboptimumg.plotting.gps_visualization.plot_gps_trajectory(x, y, time_s, *, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12))[source]#
Interactive 2D GPS trajectory plot with a two-handled time trim slider.
- Parameters:
x (NDArray[float64]) – X and Y coordinates.
y (NDArray[float64]) – X and Y coordinates.
time_s (NDArray[float64]) – Elapsed time in seconds (same length as x/y).
layout_config (LayoutConfig)
font_config (FontConfig)
- Returns:
A VBox containing the FigureWidget and the range slider. Display it directly in a notebook cell.
- Return type:
widgets.VBox
- suboptimumg.plotting.gps_visualization.plot_lap_overlay(laps, baseline_idx, *, sf_line=None, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12))[source]#
Overlay GPS trajectories for multiple laps on a 2-D scatter plot.
- Parameters:
laps (list[tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]],) – List of tuples containing Y (m) and X (m) local cartesian coordinates for each lap
baseline_idx (int) – Index of the baseline lap to be highlighted.
sf_line (LineSegment or None) – Start/finish line endpoints as ((x1, y1), (x2, y2)) in local X/Y metres.
layout_config (LayoutConfig)
font_config (FontConfig)
- Return type:
go.Figure
- suboptimumg.plotting.gps_visualization.plot_time_delta_comparison_traces(laps, *, variable_name='Variable', reference_lap=None, data_label='', dx=0.1, layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'), font_config=FontConfig(large=24, medium=16, small=12))[source]#
2-subplot comparison traces. Left subplot shows the change of a variable over distance along the track, and right subplots shows the cumulative time delta relative to a reference lap.
- Parameters:
laps (dict[label, (distance, variable, velocity)]) – Each entry maps a string label to a tuple of three equal-length float64 arrays: cumulative distance (m), the variable to plot, and velocity (m/s) used for time-delta computation.
variable_name (str) – Name of the plotted variable (axis label and title).
reference_lap (str or None) – Key from laps to use as the time-delta reference.
Noneselects the lap with the lowest estimated total time. Ignored when baseline_dist/var/vel are provided.data_label (str) – Label used in hover templates.
dx (float) – Resampling step for the common distance grid (m).
font_config (FontConfig)
layout_config (LayoutConfig)
- Return type:
go.Figure
- suboptimumg.plotting.gps_visualization.plot_track_build_verification(distance, curv_raw, curv_filt, radius_filt, x_m, y_m, *, font_config=FontConfig(large=24, medium=16, small=12), layout_config=LayoutConfig(width=1000, height=700, grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', scene_bgcolor='rgba(240, 240, 240, 0.8)', title_x=0.5, title_xanchor='center', title_yanchor='top'))[source]#
XY track shape and curvature/radius before and after spatial filter.
- Parameters:
distance (NDArray[float64]) – Uniform distance grid (m).
curv_raw (NDArray[float64]) – Raw curvature (1/m).
curv_filt (NDArray[float64]) – Filtered curvature (1/m).
radius_filt (NDArray[float64]) – Filtered radius of curvature (m).
x_m (NDArray[float64]) – East coordinates (m) same axis as longitude/x.
y_m (NDArray[float64]) – North coordinates (m) same axis as latitude/y.
font_config (FontConfig)
layout_config (LayoutConfig)
- Return type:
go.Figure
- suboptimumg.plotting.gps_visualization.plot_track_heatmap(baseline_pos_x, baseline_pos_y, baseline_var, comparison_pos_x=None, comparison_pos_y=None, comparison_var=None, *, variable_name='Variable', baseline_label='Baseline', comparison_label='Comparison', data_label='', colorscale='Viridis', title=None, layout_config=None, font_config=None, colorbar_config=None)[source]#
2D track heatmap, either single-series or 3-panel comparison.
When called with only the baseline series (no comparison arguments), a single 1:1-aspect scatter plot is returned. When comparison data is supplied, a 3-panel figure is returned: baseline, comparison projected onto the baseline spatial grid, and a signed delta panel.
The comparison series is projected via nearest-neighbour lookup (scipy cKDTree) then linearly interpolated for sparse grid points.
- Parameters:
baseline_pos_x (NDArray[float64]) – X and Y positions of the baseline series (m).
baseline_pos_y (NDArray[float64]) – X and Y positions of the baseline series (m).
baseline_var (NDArray[float64]) – Variable values for the baseline series.
comparison_pos_x (NDArray[float64] or None) – X and Y positions of the comparison series (m). All three comparison arguments must be provided together or not at all.
comparison_pos_y (NDArray[float64] or None) – X and Y positions of the comparison series (m). All three comparison arguments must be provided together or not at all.
comparison_var (NDArray[float64] or None) – Variable values for the comparison series.
variable_name (str) – Name of the variable (used in titles and colorbars).
baseline_label (str) – Panel labels (comparison mode only).
comparison_label (str) – Panel labels (comparison mode only).
data_label (str) – Label appended to hover and colorbar values.
colorscale (str) – Any Plotly named colorscale string (e.g.
"Viridis","Plasma").title (str or None) – Plot title override.
Noneuses a generated default.layout_config (LayoutConfig | None)
font_config (FontConfig | None)
colorbar_config (ColorbarConfig | None)
- Return type:
go.Figure