Skip to content

feat: publish geographic year-map deployment bounds - #1281

Merged
grojeda merged 2 commits into
masterfrom
feature/9664-gliders-yearmap-geography
Oct 30, 2026
Merged

grojeda merged 2 commits into
masterfrom
feature/9664-gliders-yearmap-geography

Conversation

@grojeda

@grojeda grojeda commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Generate a new gliders-yearmaps.json containing geographic bounding boxes for Gliders deployments, allowing the React frontend to render them directly in Mapbox without fetching or parsing legacy HTML files or loading GIF images to calculate their positions.

Changes

  • Added a Python generator to extract deployment rectangles from existing CSIRO year-map HTML files.
  • Reused mission latitude/longitude from gliders-catalogue.json to calculate geographic bounding boxes.
  • Ported the previous frontend georeferencing logic to Python, with independent calibration and validation for each map.
  • Added a publisher with source validation, atomic writes, and preservation of the previous valid JSON on failure.
  • Added unit tests, real source fixtures, and documentation.
  • Kept the existing mission catalogue generation unchanged.

Results

Validated against real CSIRO data:

Map Georeferenced deployments
2025 Slocum 27
2026 Slocum NRT 12
2018 Seaglider 0 (insufficient calibration data)

The 39 successfully georeferenced deployments have calibration errors below 1 pixel.

Maps that cannot be reliably georeferenced retain null bounding boxes rather than using estimated coordinates.

HTML Dependency

The frontend will consume the generated JSON instead of parsing HTML at runtime.

However, the generator still reads the original CSIRO HTML files on the server, as these currently provide the deployment rectangle positions and dimensions in pixels.

The existing mission catalogue provides geographic coordinates but not rectangle boundaries.

Eliminating HTML from the entire pipeline would require an alternative upstream source for this information.

Testing

  • Python unit tests passing.
  • Validated geographic calculations against the previous frontend implementation and independent map-axis references.
  • Confirmed that no GIF files are required for JSON generation.
  • No production deployment performed.

@weited weited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these files better to be hosted on ocean current own api

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The completeness check validates only map IDs, allowing incomplete HTML with missing deployments to pass validation and overwrite previously published deployments.

1 open issue
What changed in this PR

Adds a geographic year-map JSON publisher alongside the existing Gliders catalogue pipeline, enabling frontend map rendering without runtime HTML parsing or GIF-based positioning.

Changes:

  • Extracts deployment rectangles and calculates per-map geographic bounds, retaining null bounds when calibration fails.
  • Adds source stability checks, schema validation, and atomic publication.
  • Adds saved source fixtures, numeric references, tests, and usage documentation.
File Description
ARGO/​oceancurrent/​test_gliders_yearmaps.py Tests parsing, calibration, validation, and publication safeguards.
ARGO/​oceancurrent/​README.md Documents the JSON contract, calibration, and operation.
ARGO/​oceancurrent/​publish_gliders_yearmaps.py Validates sources and atomically publishes the index.
ARGO/​oceancurrent/​gliders_yearmaps.py Extracts rectangles and calculates geographic bounds.
ARGO/​oceancurrent/​fixtures/​gliders_yearmaps/​README.md Documents fixture provenance and reference calculations.
ARGO/​oceancurrent/​fixtures/​gliders_yearmaps/​frontend-reference.json Supplies frontend calibration results for parity checks.
ARGO/​oceancurrent/​fixtures/​gliders_yearmaps/​expected.json Defines expected bounds and null fallbacks.
ARGO/​oceancurrent/​fixtures/​gliders_yearmaps/​catalogue.json Supplies mission coordinates for calibration fixtures.
ARGO/​oceancurrent/​fixtures/​gliders_yearmaps/​2026_sl_temp_04d_nrt.html Provides the 2026 near-real-time Slocum source fixture.
ARGO/​oceancurrent/​fixtures/​gliders_yearmaps/​2025_sl_temp_04d.html Provides the 2025 Slocum source fixture.
ARGO/​oceancurrent/​fixtures/​gliders_yearmaps/​2018_sg_temp_04d.html Provides the Seaglider fixture for insufficient-calibration handling.

Review effort: Balanced

Comment on lines +92 to +94
missing = {m["id"] for m in previous["maps"]} - {m["id"] for m in document["maps"]}
if missing:
raise ValueError("Previously published maps disappeared; review upstream completeness: " + ", ".join(sorted(missing)))

@weited weited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grojeda
grojeda merged commit add19d7 into master Oct 30, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants