Questions tagged [xarray]

xarray is a Python module for working with N-dimensional arrays

Filter by
Sorted by
Tagged with
6
votes
1answer
2k views

xarray slicing across the antimeridian

I'm just starting with using xarray for working with n-dimensional NetCDF datasets. I particularly like the techniques for slicing using both indexes and labels (isel and sel): import xarray as xr ds ...
4
votes
1answer
374 views

GDAL crashes with segmentation fault when trying to open a NetCDF subdataset with time dimension

I am trying to create a NetCDF file which is compliant with the NetCDF Conventions CF-1.4. The dimensions of the file are (TIME, Y, X) where Y and X are the polar stereographic grid. The file that I ...
4
votes
1answer
66 views

Extracting data within geometry (shape)

I have a NetCDF dataset which I normally call using the xarray function. I have recently been doing some transect analysis on the dataset, which looks something like this (the area between the ...
1
vote
0answers
24 views

Opening EOS netCDF4/HDF5 file with correct format using xarray?

I am using xarray (version 0.12.2) to work with the MODIS/Terra+Aqua MAIAC Land Aerosol Optical Depth dataset (MCD19A2.006). xarray successfully opens that dataset with the correct variables and ...
1
vote
0answers
76 views

Calculating the area of each cell of a Dataarray (or Raster) using Python? [closed]

I would like to compute the area of each respective cell of a raster. The pixels are in degree coordinates, so it is not trivial to calculate the area of each one "manually". In R I know there is a ...
0
votes
1answer
87 views

Extract latitude and longitude from rotated coordinate system

I'm new to working with geographic data so please bear with me. I have the following data: bnds,projection_x_coordinate,projection_y_coordinate,realization,fog_area_fraction,...
0
votes
1answer
92 views

cartopy and xarray issues

I'm beginning to use netCDF4 data and therefore I have downloaded xarray and also cartopy (with pip). I have downloaded data from the climate data store and want to plot these data. I have a ...
-1
votes
1answer
1k views

How to change Numpy array shape [closed]

I have an array (Numpy of shape (100, 256, 256). How can I change this to (100, 256, 256,3)? I tried doing reshape but it doesn't work, Can anyone help me.