Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cubes with different coordinate systems work with extract_location #2186

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

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
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
2 participants