2,448 questions
Score of 0
0 answers
122 views
Error "InvalidVersion: Invalid version: 'unknown'" when triying to load netcdf files using xarray
I'm trying to load some .nc files this way:
ds = xr.open_dataset('path/to/file.nc')
At first I get no error message, but when I try to operate or simply visualize the data I get this really long ...
Score of 2
1 answer
113 views
How to calculate the mean value of a variable on a specific day of the year over several years
I have an xarray DataArray that contains daily data for every day from 1970 to 2023 for the months October through March, and I want to calculate the average value of the variable for each day (e.g. ...
Score of 0
2 answers
76 views
Looking to find the index of the nearest low-resolution grid cell for each of the lat/lon pairs in a high resolution dataset
I have 2 elevation datasets -- one is a low resolution dataset (~0.1 degree resolution), and another is a high resolution dataset (~0.001 degree resolution). Let's assume that the datasets look ...
Score of 1
1 answer
81 views
How to add crs to a xarray dataset
I am wondering how to add the crs to xarray dataset. For example if we have a min and max dataset and compute the mean. How can we set the mean dataset to have the same CRS as the min or max datasets ?...
Score of 0
1 answer
130 views
Reading multiple GRIB files using Xarray with cfgrib engine with index files in custom location
I am trying to read multiple ERA5 GRIB files using the Python Xarray's xr.mfopen_dataset() method. My ERA5 input files are on a server in a location where I only have read permission for. Therefore, I ...
Score of 3
0 answers
98 views
How to optimize NetCDF files and dask for processing long-term climataological indices with xclim (ex. SPI using 30-day rolling window)?
I am trying to analyze the 30 day standardized precipitation index for a multi-state range of the southeastern US for the year 2016. I'm using xclim to process a direct pull of gridded daily ...
Score of 0
0 answers
33 views
Introducing new dimension in xarray apply_ufunc
There has been at least one other question regarding the introduction of new dimensions in the output of xarray.apply_ufunc; I have two problems with this answer: First, I feel like the answer avoids ...
Score of 0
0 answers
118 views
Coarsening the resolution of a xarray dataset
Very new to python! I am trying to model bottom water temperatures over time and need to reduce the resolution of my model from 1/20º to 1º. My ultimate goal is to map this and select specific grid ...
Score of 2
2 answers
145 views
Convert existing dataset to rioxarray object
I have a dataset that I need to convert into a rioxarray dataset so I can use regridding features but I can't work out how to convert an already existing xarray object to rioxarray.
Unfortunately I ...
Score of 0
1 answer
88 views
how to quickly pull values from an xarray using indices
I'm working in a Jupyter Notebook using Python 3.12. I have a 2D xarray (in reality, it's 3D, but we can treat it as 2D). I want to pull out the values based on indices I acquire elsewhere, and then ...
Score of 2
0 answers
99 views
How to drop rows with a boolean mask in xarray/dask without .compute() blowing up memory?
Iâm trying to subset a large xarray.Dataset backed by Dask and save it back to Zarr, but Iâm running into a major memory problem when attempting to drop rows with a boolean mask.
Hereâs a minimal ...
Score of 0
0 answers
80 views
Adding global attributes to existing netCDF file in Xarray
I have netCDF files of oceanographic data processed in Python, that I'd like to update the global attributes of (i.e., add the same attributes to a bunch of files). Tried doing it in Xarray per their ...
Score of 0
1 answer
131 views
How can I concatenate 10 netcdf files along the time axis, while also retaining the attributes of each individual file
I am trying to concatenate 10 netCDF files that are output files from a software named Ichthyop. Each of the files is a result of a lagrangian simulation of particles drifting in the Eastern ...
Score of 0
0 answers
62 views
How to properly use joblib files in Dask?
from joblib import load
ntrees_16_model = load(r"ntrees_quantile_16_model_watermask.joblib")
ntrees_50_model = load(r"ntrees_quantile_50_model_watermask.joblib")
ntrees_84_model = ...
Score of 0
1 answer
69 views
Extreme trends in GSL (Growing Season Length) due to missing years in ERA5-Land based calculation
I calculated the Growing Season Length (GSL) index for the 1950â2023 period in Turkey using ERA5-Land daily mean temperature data. According to the definition:
First, find the first occurrence of at ...