Replies: 2 comments
-
|
If you open your dataset with xarray: import xarray
xds = xarray.open_dataset("cmems_mod_glo_bgc-pft_anfc_0.25deg_P1D-m.nc", decode_coords="all")The contents of That means this is a 4D dataset. For more information about the issue, see: #174 |
Beta Was this translation helpful? Give feedback.
-
|
Not sure it's a 4D problem. I ran into the same problem after creating a new environment. In my case, it was .nc4 files that were opening correctly with rioxarray.open_rasterio. I found that, rioxarray uses rasterio, which offer a gdal driver option, and I didn't had the proper "libgdal-netcdf" install in my new env , while I had it in my old. Try this: import rioxarray as rxr GDAL driver: https://gdal.org/en/stable/drivers/raster/index.html The good driver is obviously indicated with your file extension, but the error message sent if you don't have it wiill indicate the good command to install it (in my case : "conda install -c conda-forge libgdal-netcdf") |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to open a netCDF file with python and rioxarray:
xr = rioxarray.open_rasterio(downl_directory+"/cmems_mod_glo_bgc-pft_anfc_0.25deg_P1D-m.nc")
but it returns this error :
ValueError: conflicting sizes for dimension 'time': length 500 on the data but length 10 on coordinate 'time'
I have checked the time dimensions of the data and metadata and they match. What can I do to fix it?
Thanks in advance!
cmems_mod_glo_bgc-pft_anfc_0.25deg_P1D-m.zip
Beta Was this translation helpful? Give feedback.
All reactions