-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Bug]: slow regrid2 operation #506
Comments
@lee1043 – Is xcdat loading the data into memory while you're timing it? To check this, could you modify the xCDAT code to (note the # xCDAT
ds = xc.open_dataset('navy_land.nc', decode_times=False).load()
target_grid = xc.create_uniform_grid(-90, 90, 1.0, 0, 359, 1.0)
start_time_xcdat = time.time()
ds_regrid = ds.regridder.horizontal('sftlf', target_grid, tool='regrid2')
end_time_xcdat = time.time() xCDAT will load on demand, so it is hard to tell if the difference in time is from the regridder or I/O. |
@pochedls thank you for your comment. It is still slow after cdat wall time: 0.26210904121398926 sec |
I updated the description to include links to the code in xCDAT for whoever wants to investigate or gets to it first. |
Thank you for the update. With #533, below is the wall clock time. xcdat used to take ~3.3s in my previous test, which now takes ~1.9s. With adding cdat wall time: 0.2637472152709961 sec |
What happened?
When using
regridder.horizontal
I think its wall time is way longer than when do the same operation using cdat.What did you expect to happen? Are there are possible answers you came across?
I wonder if we can make the
regrider.horizontal
operation faster.Minimal Complete Verifiable Example (MVCE)
Relevant log output
Anything else we need to know?
Input file: navy_land.nc
The related Python modules:
xcdat/xcdat/regridder/accessor.py
Lines 163 to 208 in c70827a
xcdat/xcdat/regridder/regrid2.py
Lines 1 to 547 in c70827a
Environment
INSTALLED VERSIONS
commit: None
python: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:23:19)
[Clang 11.1.0 ]
python-bits: 64
OS: Darwin
OS-release: 22.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 2023.5.0
pandas: 2.0.0
numpy: 1.21.3
scipy: 1.10.1
netCDF4: 1.6.0
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.2
nc_time_axis: None
PseudoNetCDF: None
iris: None
bottleneck: None
dask: 2023.2.0
distributed: 2023.2.0
matplotlib: 3.4.3
cartopy: 0.20.1
seaborn: 0.11.1
numbagg: None
fsspec: 2023.5.0
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 65.5.0
pip: 21.2.4
conda: None
pytest: 6.2.5
mypy: None
IPython: 8.14.0
sphinx: 6.1.3
The text was updated successfully, but these errors were encountered: