Skip to article frontmatterSkip to article content

XArray Stack

CSIC
UCM
IGEO

Data Structures

Rasters

In general, xarray can handle most of the raster calculations. Shoutout to numpy because it always comes in handy to know how to do some operations by onesself.

xarray

numpy

xarray-dataclasses - create standardized xarray datasets and dataarrays


Vectors

If we want to manipulate polygons and convert them into raster format, we need a specialized package to do so.

GeoCube - compatibility between rasters and vectors


Remote Sensing

Here, we refer to satellite observations.

SatPy - read some common satellite data into xarray datasets.

GeoWombat - General purpose raster processor


Masks

regionmask - working with masks and shape files for xarray


Coordinate Projections

rioxarray - rasterio and xarray compatibility

GeoBox - A great little library for handling coordinates and projections. This is an example of GeoCube-Rioxarray Compatibility


Math

Linear Algebra

xarray-einstats - linear algebra, Einops and statistics

General Array Operations

ds: XRDataset["T X Y"] = ...
# combine dimensions
ds: XRDataset["N"] = rearange(ds, "(T X Y)=N")
ds: XRDataset["N T"] = rearange(ds, "(X Y)=Samples")
# Creating Patches
ds: XRDataset["N"] = rearange(ds, "T X Y -> ")
# aggregate dimensions
# options: mean, min, max, sum, prod
ds: XRDataset["T"] = reduce(ds, "X Y", "mean")
ds: XRDataset["X Y"] = reduce(ds, "T", "mean")
# pooling (max, average)

PCA/EOF/POD

xeofs - empirical orthogonal functions (PCA)


Derivatives

MetPy - derivatives and geophysical calculations

xinvert - Poisson equation inversion with numba


Spectral

xrft - Fourier transforms

xwavelet - Wavelet Transforms with xarray

Units


Interpolation

xarray-regrid - regrid rectilinear grids

pyinterp - interpolation for unstructured grids and nans

xesmf - regrid curvilinear grids

pyresample

geotiepoints


Filtering


Metrics

xskillscore - pixel-wise metrics using ufuncs


Climate

xcdat - climatology and weighted spatiotemporal reductions


Scale

We often need to deal with a large amount of data which is more

*Dask Ecosystem. *xarray-beam.


Visualization

Holoviz | GeoViews | datashader

lexcube

Terracotta - easily create a nice database for visualizing geotiffs.

Matplotlib + Cartopy

Seaborn. This is great for plotting pixel distributions.