JiaweiZhuang / xESMF

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

xesmf.Regridder(,,method='bilinear') issue #110

Open hitdxh opened 3 years ago

hitdxh commented 3 years ago

Hi, When I use xesmf to do interpolation. get the issue(which list below). Some code from my side: Some related code such like this: and some depends on my side

infile size 7.55G, 0.1 precision grib and with pressure level temprature (5 levels) system info: Ubuntu 18.04.3 LTS \n \l yaml: name: ncEnv channels:

//data_ds data_ds = xr.open_dataset(infile, engine='cfgrib') data_ds.load() data_ds = data_ds.drop(['number', 'valid_time']) data_ds = data_ds.rename(

{'isobaricInhPa': 'level', 'latitude': 'lat', 'longitude': 'lon', 'step': 'lead_time'} ) // ds_station station_info_file = '/weather-blob/ecm/foreca_station_list.csv' station_info = pd.read_csv(station_info_file) station_info.set_index('id', inplace=True) station_info.sort_index(inplace=True) ds_station = get_ds_out(station_info)

// this stage exception regridder = xesmf.Regridder(data_ds, ds_station, method='bilinear')

Traceback (most recent call last): File "/weather-nfs/users/xiadong/src/blobDownload/ECM/TransferNC.py", line 180, in interpolation_raw_data(outPrefix+file) File "/weather-nfs/users/xiadong/src/blobDownload/ECM/TransferNC.py", line 135, in interpolation_raw_data regridder = xesmf.Regridder(data_ds, ds_station, method='bilinear') File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/xesmf/frontend.py", line 239, in init self._grid_out, shape_out = ds_to_ESMFgrid(ds_out, File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/xesmf/frontend.py", line 72, in ds_to_ESMFgrid grid = esmf_grid(lon.T, lat.T, periodic=periodic, mask=None) File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/xesmf/backend.py", line 108, in esmf_grid grid = ESMF.Grid(np.array(lon.shape), staggerloc=staggerloc, File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/ESMF/util/decorators.py", line 64, in new_func return func(*args, **kwargs) File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/ESMF/api/grid.py", line 477, in init self.add_coords(staggerloc=staggerloc, from_file=from_file) File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/ESMF/api/grid.py", line 835, in add_coords self._allocatecoords(stagger, from_file=from_file) File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/ESMF/api/grid.py", line 1060, in _allocatecoords self._link_coordbuffer(xyz, stagger, localde) File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/ESMF/api/grid.py", line 1110, in _link_coordbuffer gridCoordP = ndarray_from_esmf(data, self.type, ub-lb) File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/ESMF/util/esmpyarray.py", line 38, in ndarray_from_esmf esmfarray = np.ndarray(tuple(shape[:]), constants._ESMF2PythonType[dtype], TypeError: buffer is too small for requested array