-
Notifications
You must be signed in to change notification settings - Fork 300
Closed
Description
- We can't currently regrid data with a length of only 1 in X or Y.
- What is wanted is that those cases should work as expected, analagous with "normal" 2d cases.
- It would be acceptable that we still need X and Y dims (possibly length-1)
- We could fix the unreasonable assumption in the code here though this is just the current point of failure and might not expose the full extent of the changes required.
Here is our workaround:
def regrid(src_cube, tgt_cube):
# Munge the source (duplicate source latitudes) so that we can utilise
# Linear regridding
src_cube2 = src_cube.copy()
src_cube2.coord(axis='x').points = -90
src_cube2.coord(axis='x').bounds = [-180, 0]
src_cube.coord(axis='x').points = 90
src_cube.coord(axis='x').bounds = [0, 180]
src_cube = iris.cube.CubeList([src_cube, src_cube2]).concatenate_cube()
return src_cube.regrid(tgt_cube, iris.analysis.Linear())Target grids can be global UM grids or whatever regional models like UKV etc.