Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hitdxh opened this issue Nov 24, 2020 · 0 comments
Open

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

hitdxh opened this issue Nov 24, 2020 · 0 comments

Comments

@hitdxh
Copy link

hitdxh commented Nov 24, 2020

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:

  • conda-forge
  • defaults
    dependencies:
  • _libgcc_mutex=0.1=conda_forge
  • _openmp_mutex=4.5=1_gnu
  • attrs=20.3.0=pyhd3deb0d_0
  • bzip2=1.0.8=h516909a_3
  • c-ares=1.16.1=h516909a_3
  • ca-certificates=2020.11.8=ha878542_0
  • certifi=2020.11.8=py39hf3d152e_0
  • cffi=1.14.3=py39h0da4893_1
  • cfgrib=0.9.8.5=pyhd8ed1ab_0
  • click=7.1.2=pyh9f0ad1d_0
  • curl=7.71.1=he644dc0_8
  • eccodes=2.19.1=ha0e6eb6_0
  • esmf=8.0.1=nompi_he31a43a_2
  • esmpy=8.0.1=nompi_py39hfd06839_2
  • hdf4=4.2.13=hf30be14_1003
  • hdf5=1.10.6=nompi_h1022a3e_1110
  • jasper=1.900.1=h07fcdf6_1006
  • jpeg=9d=h36c2ea0_0
  • krb5=1.17.2=h926e7f8_0
  • ld_impl_linux-64=2.35.1=hed1e6ac_0
  • libaec=1.0.4=he1b5a44_1
  • libblas=3.9.0=3_openblas
  • libcblas=3.9.0=3_openblas
  • libcurl=7.71.1=hcdd3856_8
  • libedit=3.1.20191231=he28a2e2_2
  • libev=4.33=h516909a_1
  • libffi=3.2.1=he1b5a44_1007
  • libgcc-ng=9.3.0=h5dbcf3e_17
  • libgfortran-ng=9.3.0=he4bcb1c_17
  • libgfortran5=9.3.0=he4bcb1c_17
  • libgomp=9.3.0=h5dbcf3e_17
  • liblapack=3.9.0=3_openblas
  • libnetcdf=4.7.4=nompi_hefab0ff_106
  • libnghttp2=1.41.0=h8cfc5f6_2
  • libopenblas=0.3.12=pthreads_h4812303_1
  • libpng=1.6.37=h21135ba_2
  • libssh2=1.9.0=hab1572f_5
  • libstdcxx-ng=9.3.0=h2ae2ef3_17
  • ncurses=6.2=h58526e2_4
  • netcdf-fortran=4.5.3=nompi_h1a0d97b_101
  • numpy=1.19.4=py39h57d35e7_1
  • openssl=1.1.1h=h516909a_0
  • pandas=1.1.4=py39h9cfe711_0
  • pip=20.2.4=py_0
  • pycparser=2.20=pyh9f0ad1d_2
  • python=3.9.0=h2a148a8_4_cpython
  • python-dateutil=2.8.1=py_0
  • python_abi=3.9=1_cp39
  • pytz=2020.4=pyhd8ed1ab_0
  • readline=8.0=he28a2e2_2
  • scipy=1.5.3=py39hee8e79c_0
  • setuptools=49.6.0=py39h079e4ff_2
  • six=1.15.0=pyh9f0ad1d_0
  • sqlite=3.33.0=h4cf870e_1
  • tk=8.6.10=hed695b0_1
  • tzdata=2020d=h516909a_0
  • wheel=0.35.1=pyh9f0ad1d_0
  • xarray=0.16.1=py_0
  • xesmf=0.4.0=pyhd8ed1ab_0
  • xz=5.2.5=h516909a_1
  • zlib=1.2.11=h516909a_1010
  • pip:
    • iniconfig==1.1.1
    • packaging==20.4
    • pluggy==0.13.1
    • py==1.9.0
    • pyparsing==2.4.7
    • pytest==6.1.2
    • toml==0.10.2

//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.allocate_coords(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 allocate_coords
self.link_coord_buffer(xyz, stagger, localde)
File "/weather-nfs/users/xiadong/anaconda3/envs/ncEnv/lib/python3.9/site-packages/ESMF/api/grid.py", line 1110, in link_coord_buffer
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

aulemahal pushed a commit to Ouranosinc/xESMF that referenced this issue Oct 1, 2021
…b_actions/styfle/cancel-workflow-action-0.9.1

Bump styfle/cancel-workflow-action from 0.9.0 to 0.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant