Closed valeriupredoi closed 1 month ago
@valeriupredoi in your post, the second region (reproduced below) retains the ancillary variables, right? I think you forgot to change a word in the code comment.
# intersection cube loses ancillary variables extract_region(cube, start_longitude=160, end_longitude=280, start_latitude=-5, end_latitude=5 )
Thanks for looking into it and submitting this issue!
well spotted @rebeccaherman1 - corrected now, cheers :+1:
cheers folks :beer:
Hey folks,
Here's one sneaky one for you:
Main point
An iris cube that has ancillary variables and cell_measures, upon intersecting it with a region via
cube.intersect
may lose those ancillary variables and cell_measures depending on what the coordinates of the intersected region are.Minimal fully reproducible code
cube_to_intersect_smol.nc
attached here (rename to .nc, size=1.2M, smol like I says) cube_to_intersect_smol.nc.txtHave I looked at docs?
Yes https://scitools-iris.readthedocs.io/en/latest/generated/api/iris.cube.html#iris.cube.Cube.intersection no mention of any side effects, coordinates are circular
Iris version and installation type
AOBs
Related to https://github.com/SciTools/iris/issues/3483
Great many thanks in advance! Many thanks to @rebeccaherman1 for alerting me to this via https://github.com/ESMValGroup/ESMValCore/issues/2162
Obligatory pint emoji
:beer: