Skip to content

Commit

Permalink
metum files: also correct other lon coordinates (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Oct 11, 2018
1 parent ed4a76d commit 6f5e707
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions salem/sio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,11 @@ def open_metum_dataset(file, pole_longitude=None, pole_latitude=None,
ds = xr.open_dataset(file, **kwargs)

# Correct for lons
v = ds['grid_longitude_t']
ds['grid_longitude_t'] = v.where(v <= 180, v - 360)
vn_list = ['grid_longitude_t', 'grid_longitude_uv', 'rlon']
for vn in vn_list:
if vn in ds.coords:
v = ds[vn]
ds[vn] = v.where(v <= 180, v - 360)

# get pyproj string
if pole_longitude is None or pole_latitude is None:
Expand Down

0 comments on commit 6f5e707

Please sign in to comment.