perda.utils.gps_trimmer#

perda.utils.gps_trimmer.plot_gps_trimmer(lat, lon, timestamp_unit, title=None, layout_config=LayoutConfig(width=1200, height=700, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', title_x=0.5, title_xanchor='center', title_yanchor='top', grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, max_display_resolution=50), font_config=FontConfig(large=20, medium=14, small=10))[source]#

Interactive GPS coordinate trimmer with a dual-handle range slider.

Displays a 2D scatter plot of GPS coordinates (longitude vs latitude) alongside an ipywidgets IntRangeSlider that trims which points are shown. Designed for use in Jupyter notebooks.

Parameters:
  • lat (DataInstance) – Latitude values. Must have the same length and identical timestamps as lon.

  • lon (DataInstance) – Longitude values. Must have the same length and identical timestamps as lat.

  • timestamp_unit (Timescale) – Timestamp unit used for the slider timestamp labels. Pass aly.data.timestamp_unit.

  • title (str | None, optional)

  • layout_config (LayoutConfig, optional)

  • font_config (FontConfig, optional)

Return type:

ipywidgets.VBox

Examples

>>> from perda.utils import plot_gps_trimmer
>>> widget = plot_gps_trimmer(lat_di, lon_di, aly.data.timestamp_unit, title="GPS Track")
>>> display(widget)