Skip to content

Add ERA5-WRF 4km elevation grid endpoint#708

Open
charparr wants to merge 12 commits intomainfrom
era5_4km_elevation
Open

Add ERA5-WRF 4km elevation grid endpoint#708
charparr wants to merge 12 commits intomainfrom
era5_4km_elevation

Conversation

@charparr
Copy link
Member

@charparr charparr commented Mar 16, 2026

Add the ERA5-WRF 4 km elevation grid data to the existing top-level elevation route

This PR enables /point/ and /area/ requests that determine the grid cell elevation that is representative of any data product that is constructed from, or downscaled to, the ERA5-WRF 4 km dynamically downscaled data. This includes the ERA5-WRF climate data itself (i.e. anything falling under the /era5wrf/ top-level route) as well as the downscaled CMIP6 for which the WRF-downscaled ERA5 is the baseline. This endpoint is motivated by the idea that including the representative grid cell elevations adjacent to the climate data itself could mitigate some of the geospatial uncertainty inherent in using gridded model and renanalysis data, and perhaps enable further bias correction via adiabatic lapse rates, elevation driven rain-snow transitions, etc.

The elevation API documentation is updated to describe the new ERA5-WRF 4 km elevation grid option, and some of the existing language has been generalized a bit because now there are two potential data sources under the top-level elevation route, instead of just one.

Notes

  • This PR also removes the deprecated elevation/abstract route synonym (XREF Remove /abstract/ route synonyms throughout #618)
  • This PR does not impact the existing ASTER GDEM endpoint that is used to characterize elevation variance within a 1 km radius
  • This is just a 2D coverage on the backend, and so it could theoretically be a good fit to deliver via GeoServer, rather than Rasdaman. However, because the grid for this endpoint is shared across so many Rasdaman coverages, it struck me as a good idea to deliver it via Rasdaman so we can be certain that this coverage is being queried in the exact same day as the climate data that is associated with it

Tests

Added the expected elevation API response JSON for:

  • A GMU23 zonal statistics / area request
  • A point elevation request

And these fixtures are wired into the existing elevation test suite.

To run these tests:

pytest tests/test_elevation.py

Both new tests, along with the existing test for the ASTER GDEM data, should pass.

Closes #705
Closes #696

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds ERA5-WRF 4 km grid-cell elevation support under the existing top-level /elevation API so clients can retrieve representative model-grid elevation for /point/ and /area/ queries.

Changes:

  • Adds new /elevation/point/era5_4km/<lat>/<lon> and /elevation/area/era5_4km/<var_id> routes backed by Rasdaman WCS.
  • Updates elevation documentation to describe two elevation data sources (ASTER GDEM + ERA5-WRF 4 km grid).
  • Extends the elevation test suite with new fixtures and test cases; removes the deprecated /elevation/abstract/ synonym.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
routes/elevation.py Implements new ERA5-WRF 4 km elevation point + area endpoints and packaging/zonal-stat logic.
templates/documentation/elevation.html Expands docs to include the new ERA5-WRF 4 km elevation option and updates examples.
tests/test_elevation.py Adds tests for the new ERA5-WRF 4 km point/area elevation endpoints.
tests/elevation_point_era5_4km_65.0628_-146.1627.json Expected JSON response fixture for the new point endpoint.
tests/elevation_area_era5_4km_GMU23.json Expected JSON response fixture for the new area endpoint.
Comments suppressed due to low confidence (1)

templates/documentation/elevation.html:296

  • The template ends with a stray closing after the Jinja {% endblock %}. Since there is no matching opening for this section, the markup is unbalanced; remove this closing tag (and any unmatched opening ) so the page remains well-formed.
  {% endblock %}
</tfoot>


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

charparr and others added 5 commits March 17, 2026 15:03
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

Integrate ERA5 4 km Grid Elevation into Existing elevation route Add ERA5WRF pixel elevation

2 participants