-
Notifications
You must be signed in to change notification settings - Fork 12
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]: NaN handling in regrid2 #580
Labels
type: bug
Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone
Comments
Close this issue as it was resolved by #533. Result of the minimal example code above after updating the xcdat to the latest main branch. |
Thank you for confirming! |
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type: bug
Inconsistencies or issues which will cause an issue or problem for users or implementors.
What happened?
When NaN value exists in the original field, interpolation using regrid2 replaces NaN values to zero, then interpolates, which introduces error in the resulted field.
unmapped_to_nan=True
that was discussed in #528 forxesmf
is not available forregrid2
, wondering if that could be added.What did you expect to happen? Are there are possible answers you came across?
Original field has NaN values over the ocean, and when interpolate, it should look like one in the middle (example used xesmf). However, regrid2 injects zeros to NaN values before interpolation, then interpolates, resulting zero over land and gradation values along coastlines.
Minimal example code to reproduce the above plot is attached below.
Minimal Complete Verifiable Example (MVCE)
Relevant log output
No response
Anything else we need to know?
Sample input files used above:
Environment
xcdat 0.6.1
xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:17:34) [Clang 14.0.6 ]
python-bits: 64
OS: Darwin
OS-release: 22.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: (None, 'UTF-8')
libhdf5: 1.14.2
libnetcdf: 4.9.2
xarray: 2023.11.0
pandas: 2.1.3
numpy: 1.23.5
scipy: 1.11.4
netCDF4: 1.6.5
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.3
nc_time_axis: 1.4.1
iris: None
bottleneck: None
dask: 2023.12.0
distributed: 2023.12.0
matplotlib: 3.7.1
cartopy: 0.22.0
seaborn: 0.12.2
numbagg: None
fsspec: 2023.12.0
cupy: None
pint: None
sparse: 0.14.0
flox: None
numpy_groupies: None
setuptools: 67.7.2
pip: 23.1.2
conda: None
pytest: None
mypy: None
IPython: 8.18.1
sphinx: None
The text was updated successfully, but these errors were encountered: