Skip to content

Commit

Permalink
Limit lon to -180 to 180 in lon-lat region masks
Browse files Browse the repository at this point in the history
This is needed for grids where longitude is from 0 to 360 and it
is inconvenient to modify the grid before passing it to the
command-line tool.
  • Loading branch information
xylar committed Jan 8, 2024
1 parent de7286e commit ba7dd43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conda_package/mpas_tools/mesh/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ def compute_lon_lat_region_masks(lon, lat, fcMask, logger=None, pool=None,

dsMasks = xr.Dataset()

# make sure lon is between -180 and 180
lon = numpy.mod(lon + 180., 360.) - 180.

Lon, Lat = numpy.meshgrid(lon, lat)

shape = Lon.shape
Expand Down

0 comments on commit ba7dd43

Please sign in to comment.