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

interpolate using quadratic returns nan #9028

Open
5 tasks done
nkarasiak opened this issue May 15, 2024 · 1 comment
Open
5 tasks done

interpolate using quadratic returns nan #9028

nkarasiak opened this issue May 15, 2024 · 1 comment
Labels

Comments

@nkarasiak
Copy link
Contributor

What happened?

When using a multiple dimensions xarray (like time, x and y), the quadratic function is not working anymore with interpolate, it returns only nan. slinear is ok. quadratic is only ok when using only a dimension (like only a lat/lon value).

What did you expect to happen?

No response

Minimal Complete Verifiable Example

import xarray as xr

ds = xr.tutorial.load_dataset("ersstv5")
# Generate a subset
subset = ds['sst'].isel(time=slice(0,10),lat=slice(20,40),lon=slice(20,40))
## Plot images
subset.plot(col="time",col_wrap=6)

# Interpolate with quadratic
subset_quadratic = subset.resample(time='10D').interpolate('quadratic')
## subset_quadratic is now full of NaN
subset_quadratic.plot(col="time",col_wrap=6)

# Working with only time dimension
subset_quadratic = subset.isel(lat=0,lon=0).resample(time='10D').interpolate('quadratic')
subset_quadratic.plot()

MVCE confirmation

  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.
  • Recent environment — the issue occurs with the latest version of xarray and its dependencies.

Relevant log output

No response

Anything else we need to know?

No response

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:20:11) [MSC v.1938 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 11 machine: AMD64 processor: Intel64 Family 6 Model 186 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: en LOCALE: ('fr_FR', 'cp1252') libhdf5: 1.14.3 libnetcdf: None

xarray: 2024.5.0
pandas: 2.1.4
numpy: 1.26.4
scipy: 1.13.0
netCDF4: None
pydap: None
h5netcdf: 1.3.0
h5py: 3.11.0
zarr: 2.18.0
cftime: None
nc_time_axis: None
iris: None
bottleneck: None
dask: 2024.5.0
distributed: 2024.5.0
matplotlib: 3.8.4
cartopy: None
seaborn: 0.13.2
numbagg: None
fsspec: 2024.3.1
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 69.5.1
pip: 24.0
conda: None
pytest: None
mypy: None
IPython: 8.24.0
sphinx: 7.3.7

@nkarasiak nkarasiak added bug needs triage Issue that has not been reviewed by xarray team member labels May 15, 2024
Copy link

welcome bot commented May 15, 2024

Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!

@dcherian dcherian removed the needs triage Issue that has not been reviewed by xarray team member label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants