Category "python-xarray"

Xarray - how to regrid or sum up area variables for different grid resolutions?

I have a dataset at a given resolution and its variable is an Area measure. When regridding to another resolution, the techniques are usually interpolation (bil

selecting an xarray dataset by coordinates instead of dimensions (or switching coordinates to dimensions)

I have a, xarray dataset that is ocean color of the Atlantic Ocean called olci_ds. This dataset has dimensions of rows and columns and coordinates of lat, lon a

IO backend error in the xarray for netcdf file

I am trying to open a .netcdf file using xarray and it is showing this error. I am unable to resolve this error and I have found no such solution to resolve thi

How to add title when I use xarray to plot

I use 'xarray' to read nc file and plot a figure. I achieved the figure, but I don't know how to modify the title of the figure. Please see the code below. impo

Applying a function to each timestep in an xarray.Dataset, and return lazy Dask array outputs

I have an xarray.Dataset with two 1D variables sun_azimuth and sun_elevation with multiple timesteps along the time dimension: import xarray as xr import numpy

Compute annual mean using x-arrays

I have a python xarray dataset with time,x,y for its dimensions and value1 as its variable. I'm trying to compute annual mean of value1 for each x,y coordinate

combining 2 netcdf files with xarray along the time dimension

I tried to combine two netcdf files along the time dimension using this command. The first file ran 1 to 10 days and then the next one from 11 to 20 days. Time

Iterating over xarray. DataArray first dimension and its coordinates

Suppose I have the following DataArray arr = xarray.DataArray(np.arange(6).reshape(2,3), dims=['A', 'B'], coords

Apply function along time dimension of XArray

I have an image stack stored in an XArray DataArray with dimensions time, x, y on which I'd like to apply a custom function along the time axis of each pixel su

Dask-SLURMCluster: [Errno 104] Connection reset by peer

I'm running into a problem using a Xarray together with SLURMcluster from Dask. I'm using pandas_plink to load some data into a Xarray, then filtering it and ma

Keeping time-series while grouping by season in xarray

I would like to have the winter (DJF) average for every year to plot a time-series. I know that I can group by season if I have a data array (DA). I don't know

How to read .csv with a compound header into a xarray DataArray (using pandas)

Given a dataset with the following structure: time var1 var2 var2 var1 var3 loc1 loc1 loc2 loc2 loc1 1 11 12 13 14 15 2 21

How to read .csv with a compound header into a xarray DataArray (using pandas)

Given a dataset with the following structure: time var1 var2 var2 var1 var3 loc1 loc1 loc2 loc2 loc1 1 11 12 13 14 15 2 21

align a cartopy 2D map plot with a 1D line plot

I need to align a cartopy 2D map subplot with a 1D line subplot, using the following code: import xarray as xr import cartopy.crs as ccrs import matplotlib.pyp

get mean of netcdf file using xarray

I have opened a netcdf file in python using xarray, and the dataset summary looks like this. Dimensions: (latitude: 721, longitude: 1440, time: 41) Coordinat