You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Iris ESMF-regid to regrid data such as rotated pole data that includes auxiliary coords of true longitude two coords are returned not a single one
How To Reproduce
Steps to reproduce the behaviour:
load CORDEX data on rotated pole grid wtih lat and lon 2D coords e.g cube = iris.load_cube('pr_AFR-22_NCC-NorESM1-M_historical_r1i1p1_CLMcom-KIT-CCLM5-0-15_v1_day_19500101-19501231.nc')
It should also fall back on the current implementation by using a try-except block.
The only scenario producing an error would then be no DimCoords and multiple AuxCoords on the same axis, which is truly ambiguous and would need the user to help by massaging the input.
File "/home/b/b381943/mambaforge/envs/coretool26rc4/lib/python3.10/site-packages/iris/cube.py", line 4359, in regrid
regridder = scheme.regridder(self, grid)
File "/home/b/b381943/mambaforge/envs/coretool26rc4/lib/python3.10/site-packages/esmf_regrid/schemes.py", line 338, in regridder
return ESMFAreaWeightedRegridder(src_grid, tgt_grid, mdtol=self.mdtol)
File "/home/b/b381943/mambaforge/envs/coretool26rc4/lib/python3.10/site-packages/esmf_regrid/schemes.py", line 367, in __init__
regrid_info = _regrid_rectilinear_to_rectilinear__prepare(src_grid, tgt_grid)
File "/home/b/b381943/mambaforge/envs/coretool26rc4/lib/python3.10/site-packages/esmf_regrid/schemes.py", line 186, in _regrid_rectilinear_to_rectilinear__prepare
src_x = src_grid_cube.coord(axis="x")
File "/home/b/b381943/mambaforge/envs/coretool26rc4/lib/python3.10/site-packages/iris/cube.py", line 1908, in coord
raise iris.exceptions.CoordinateNotFoundError(emsg)
iris.exceptions.CoordinateNotFoundError: 'Expected to find exactly 1 coordinate, but found 2. They were: projection_x_coordinate, longitude.'
🐛 Bug Report
When using Iris ESMF-regid to regrid data such as rotated pole data that includes auxiliary coords of true longitude two coords are returned not a single one
How To Reproduce
Steps to reproduce the behaviour:
cube = iris.load_cube('pr_AFR-22_NCC-NorESM1-M_historical_r1i1p1_CLMcom-KIT-CCLM5-0-15_v1_day_19500101-19501231.nc')
Expected behaviour
the aux coord should be ignored in favour of the dim coord
Screenshots
Environment
esmf_regrid
version:'0.4.0'Additional context
Click to expand this section...
We believe this can be resolved by having iris-esmf-regrid search
Coord
s usingdim_coord=True
in these searches:https://github.com/SciTools-incubator/iris-esmf-regrid/blob/7d6f568e8659109b5c8226f53dd27f5a5dd31f51/esmf_regrid/schemes.py#L184-L187
It should also fall back on the current implementation by using a try-except block.
The only scenario producing an error would then be no
DimCoord
s and multipleAuxCoord
s on the same axis, which is truly ambiguous and would need the user to help by massaging the input.See here for further details.
The text was updated successfully, but these errors were encountered: