JiaweiZhuang / xESMF

Universal Regridder for Geospatial Data
http://xesmf.readthedocs.io/
MIT License
269 stars 49 forks source link

After interpolation, 0s show up on edges #20

Closed ahuang11 closed 6 years ago

ahuang11 commented 6 years ago

Is it possible to have it return np.nan instead?

image image

!wget https://www.ncei.noaa.gov/data/outgoing-longwave-radiation-daily/access/olr-daily_v01r02-preliminary_20170101_20171231.nc

import numpy as np
import xarray as xr
import xesmf

ds = xr.open_dataset('olr-daily_v01r02-preliminary_20170101_20171231.nc').olr
ds_out = xr.Dataset({'lat': (['lat'], np.arange(-90, 92.5, 2.5)),
                     'lon': (['lon'], np.arange(0, 360, 2.5)),
                    }
                   )
regridder = xe.Regridder(ds, clim_u_ds, 'bilinear')
regridder(ds).isel(time=0).plot()
ahuang11 commented 6 years ago

Actually probably a duplicate of https://github.com/JiaweiZhuang/xESMF/issues/15

JiaweiZhuang commented 6 years ago

For global grid, try periodic=True when building the regridder