Skip to content

Commit

Permalink
allow regridding for projections in non-degree type units
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenworsley committed Aug 31, 2023
1 parent 97d0257 commit 976a61c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions esmf_regrid/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ def _cube_to_GridInfo(cube, center=False, resolution=None, mask=None):
lat_bound_array = _contiguous_masked(lat.bounds, mask)
# 2D coords must be AuxCoords, which do not have a circular attribute.
circular = False
lon_bound_array = lon.units.convert(lon_bound_array, Unit("degrees"))
lat_bound_array = lat.units.convert(lat_bound_array, Unit("degrees"))
lon_points = lon.units.convert(lon.points, Unit("degrees"))
lat_points = lon.units.convert(lat.points, Unit("degrees"))
if crs is None:
lon_bound_array = lon.units.convert(lon_bound_array, Unit("degrees"))
lat_bound_array = lat.units.convert(lat_bound_array, Unit("degrees"))
lon_points = lon.units.convert(lon.points, Unit("degrees"))
lat_points = lon.units.convert(lat.points, Unit("degrees"))
if resolution is None:
grid_info = GridInfo(
lon_points,
Expand Down

0 comments on commit 976a61c

Please sign in to comment.