2,451 questions
1
vote
0
answers
37
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 ...
2
votes
1
answer
99
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. ...
0
votes
2
answers
70
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 ...
0
votes
1
answer
65
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 ?...
0
votes
1
answer
97
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 ...
3
votes
0
answers
91
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 ...
0
votes
0
answers
30
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 ...
0
votes
0
answers
96
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 ...
2
votes
2
answers
128
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 ...
0
votes
1
answer
81
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 ...
2
votes
0
answers
90
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 ...
0
votes
0
answers
74
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 ...
0
votes
1
answer
124
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 ...
0
votes
0
answers
60
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 = ...
0
votes
1
answer
64
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 ...