Skip to content

Conversation

nhsavage
Copy link

@nhsavage nhsavage commented Aug 30, 2023

Description

When using CORDEX data on a model with a rotated pole grid with the extract_location pre-processor it fails with:

ValueError: Interpolation coords must be 1-d for rectilinear interpolation.

This branch extends the function: extract_point in preprocessor/_regrid.py
to cope with cases where the dimension coordinates are not latitude and longitude

Closes #2177

TO DO:

  • add suitable integration and unit tests for the new functionality
  • rebase once changes to unit testing made by Emma Hogan are on main Remove mocking from tests in tests/unit/preprocessor/_regrid/test_extract_point.py #2193
  • some changes to documentation will be needed - the dimensions are different if the cube is not in latitude and longitude because there is no longer a 1:1 mapping of the scalar coordinate to a single value in either x or y

Link to documentation:


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Merging #2186 (64e5e76) into main (4fd8701) will decrease coverage by 0.10%.
Report is 10 commits behind head on main.
The diff coverage is 35.00%.

❗ Current head 64e5e76 differs from pull request most recent head 5f254f7. Consider uploading reports for the commit 5f254f7 to get more accurate results

@@            Coverage Diff             @@
##             main    #2186      +/-   ##
==========================================
- Coverage   93.10%   93.01%   -0.10%     
==========================================
  Files         237      237              
  Lines       12826    12845      +19     
==========================================
+ Hits        11942    11948       +6     
- Misses        884      897      +13     
Files Coverage Δ
esmvalcore/preprocessor/_regrid.py 94.76% <35.00%> (-3.49%) ⬇️

@nhsavage nhsavage self-assigned this Aug 30, 2023
Copy link
Contributor

In order to maintain a backlog of relevant pull requests, we automatically label them as stale after 180 days of inactivity.

If this pull request is still important to you, please comment below to remove the stale label. Otherwise, this pull request will be automatically closed in 60 days. If this pull request only suffers from a lack of reviewers, please tag the @ESMValGroup/technical-lead-development-team so they can help you find a suitable reviewer.

@github-actions github-actions bot added the Stale label Jun 27, 2025
@valeriupredoi
Copy link
Contributor

shut up, bot! I reckon we should revisit this one soon

@github-actions github-actions bot removed the Stale label Jul 8, 2025
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.

extract_location pre-processor fails for cubes with 2D latitude and longitude arrays
3 participants