Skip to content

Preserve model coordinates across ERA5 sampling backends - #47

Merged
jonschwenk merged 2 commits into
mainfrom
fix/preserve-era5-model-coordinates
Sep 17, 2026
Merged

jonschwenk merged 2 commits into
mainfrom
fix/preserve-era5-model-coordinates

Conversation

@jonschwenk

Copy link
Copy Markdown
Collaborator

Summary

  • preserve canonical Domain.cells geometry, longitude, latitude, zone, and weights when attaching ERA5 sampling provenance
  • record GEE sampling-geometry coordinates separately as sampling_reference_lon and sampling_reference_lat
  • propagate those references, plus the requested ARCO start date, into ELM met metadata
  • document that backend selection cannot redefine the model grid

Why

GEE replaces polygons containing no ERA5 pixel centers with a centroid for sampling. That sampling-only fallback was being copied back into the Domain model coordinates, while ARCO retained the original polygon's representative point. For TL27 this moved zone_mappings.txt by about 79 m and made newly generated met files inconsistent with established domain and surface files.

The GEE fallback remains available for data extraction, but it can no longer overwrite the coordinate used by zone_mappings.txt, LONGXY/LATIXY, domain files, or surface files.

Verification

  • regression test simulates a differing GEE fallback point and confirms geometry, coordinates, zone, and weight remain unchanged
  • GEE and ARCO exports produce byte-identical zone_mappings.txt for the same Domain
  • sampling-reference coordinates are retained in GEE NetCDF metadata
  • 46 passed, 1 skipped
  • Sphinx HTML build succeeded; five existing documentation warnings remain

@jonschwenk
jonschwenk merged commit 925b9af into main Sep 17, 2026
3 checks passed
@jonschwenk
jonschwenk deleted the fix/preserve-era5-model-coordinates branch September 17, 2026 19:22
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