Extract region from a cube with 2D latitude/longitude coordinates
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with iris.cube.Cube.intersection and compare the related implementation in ESMValCore pull request 245. Define how rectangular selection should work for 2D latitude and longitude coordinates, including whether points outside the region are masked, then verify the example no longer raises CoordinateMultiDimError.
Written by the indexing model from the issue text.
Description
✨ Feature Request
Motivation
When working with ocean model data, it would be really convenient if iris.cube.Cube.intersection supported 2D latitude and longitude coordinates. Currently
import iris
cube = iris.load_cube("http://esgf1.dkrz.de/thredds/dodsC/cmip5/cmip5/output1/MPI-M/MPI-ESM-LR/historical/mon/ocean/Omon/r1i1p1/v20120625/tos/tos_Omon_MPI-ESM-LR_historical_r1i1p1_185001-200512.nc")
cube.intersection(
longitude=(10, 20),
latitude=(10, 20),
ignore_bounds=True,
)
throws a
CoordinateMultiDimError: Multi-dimensional coordinate not supported: 'longitude'
These coordinates are 2D because they are close enough to a rectangular grid to make this a meaningful data storage format. Therefore it makes sense to be able to select a rectangular cube slice for this type of data. Any points that are outside the region but inside the rectangular slice could e.g. be masked.
I recently implemented something like this in https://github.com/ESMValGroup/ESMValCore/pull/245, but it would be much nicer if this could be supported in iris.
- Dominant language
- Python
- Stars
- 724
- Forks
- 317
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SciTools/iris
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100