Skip to content

Add coordinate reference system (CRS) support to acoustic localization#1263

Open
martinguthrie93 wants to merge 1 commit into
kitzeslab:developfrom
martinguthrie93:feat_crs_support
Open

Add coordinate reference system (CRS) support to acoustic localization#1263
martinguthrie93 wants to merge 1 commit into
kitzeslab:developfrom
martinguthrie93:feat_crs_support

Conversation

@martinguthrie93

@martinguthrie93 martinguthrie93 commented Jul 2, 2026

Copy link
Copy Markdown

Summary

Adds optional coordinate reference system (CRS) support to the localization module,
so users can work directly with geographic coordinates (longitude/latitude) instead of
manually projecting to meters. Closes #1262.

What changed

  • New opensoundscape/localization/coordinates.py with pyproj-backed helpers:
    utm_epsg_for_lonlat, lonlat_to_xy, xy_to_lonlat, project_file_coords.
  • SynchronizedRecorderArray: new from_lonlat() classmethod that projects lon/lat
    receiver coordinates to a metric CRS (auto-selects the UTM zone), plus a crs
    attribute propagated to each returned PositionEstimate.
  • PositionEstimate: new crs field and location_estimate_lonlat property that
    converts the estimated location back to longitude/latitude.
  • pyproj added as an optional dependency + localization extra
    (pip install opensoundscape[localization]). Core install is unaffected.

Why

Field recorders log positions as lon/lat (WGS84), but localization requires Cartesian
meters. Previously users had to manually pick a UTM zone and convert coordinates by
hand (error-prone). This makes the lon/lat → localization → mapped-result path direct.

Testing

  • New tests/test_coordinates.py (12 tests): round-trip conversion, UTM zone
    selection (N/S hemisphere), from_lonlat, location_estimate_lonlat, dict
    round-trip. Skipped automatically if pyproj is not installed.
  • All existing localization tests still pass (47 passed locally).
  • black formatting applied.

@martinguthrie93 martinguthrie93 changed the title Add CRS/Projection support to localization(closes #<1262>) Add coordinate reference system (CRS) support to acoustic localization Jul 2, 2026
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.

1 participant