-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
impossible to save in netcdf because of the time dimension #8858
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
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
Thanks for the report. Could you show how you managed to get |
@jfleroux This might be a regression in reading the data. In general datetimes are always represented as Lines 429 to 440 in 61ffc38
fails and the code is entering the second path (cf_time handling). Could you change your time data to |
my dataset comes from netcdf files opened through an intake catalog. The individual netcdf files have a time of type datetime64[ns] |
this sounds very much like #6318. @jfleroux, can you confirm that ds['TEMP'].assign_coords(time=lambda ds: ds["time"].astype("datetime64[ns]")).isel(time=slice(0,1)).to_netcdf(f"./extract.nc") |
Yes it's ok with the work around : @keewis : yes, I use intake catalog with kerchunk and zarr |
Awesome, thanks for confirming that it's the kerchunk-related issue @jfleroux. |
What happened?
I have a dataset ds with a variable TEMP(time,level,ni,nj).
The time dimension a of type datetime64 but I get an error when I try to save a temporal selection.
What did you expect to happen?
Time dimension management should be completely transparent to the user when a datetime64 type is used.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
No response
Environment
INSTALLED VERSIONS
commit: None
python: 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:50:58) [GCC 12.3.0]
python-bits: 64
OS: Linux
OS-release: 3.12.53-60.30-default
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.3
libnetcdf: 4.9.2
xarray: 2024.2.0
pandas: 2.2.1
numpy: 1.26.4
scipy: 1.12.0
netCDF4: 1.6.5
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.17.1
cftime: 1.6.3
nc_time_axis: None
iris: None
bottleneck: None
dask: 2024.3.1
distributed: 2024.3.1
matplotlib: 3.8.3
cartopy: 0.22.0
seaborn: None
numbagg: None
fsspec: 2024.3.0
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 69.2.0
pip: 24.0
conda: None
pytest: None
mypy: None
IPython: 8.22.2
sphinx: None
The text was updated successfully, but these errors were encountered: