What it does¶
-
Automatic grid detection
Regular (ERA5, CMIP), curvilinear and rotated-pole (NEMO, CORDEX, WRF) and unstructured (ICON) grids are recognised from the dataset itself.
-
Conservative remapping
Conservative and nearest-neighbour remapping with ESMF weights, on the sphere or the WGS84 ellipsoid.
-
A shared weights store
Weights are computed once per source grid, HEALPix level and method, and reused by everyone pointing at the same directory.
-
Point binning
Swaths, stations and trajectories, where every sample has its own position, are binned into HEALPix cells.
-
Pyramids
From the finest level down to level 0, with mean or mode coarsening and valid fractions for masked fields.
-
Parallel writes
Zarr stores in one call, or split into independent tasks for HPC array jobs.
-
Region selection
By bounding box, cone or cell list, also for stores without coordinate arrays.
-
CF metadata
The CF
healpixgrid mapping and a record of how every level was built.
Regridding and coarsening run lazily on dask arrays.
Quick example¶
import xarray as xr
import grid_doctor as gd
ds = xr.open_mfdataset("data/*.nc")
pyramid = gd.create_healpix_pyramid(ds) # finest level from the grid resolution
gd.save_pyramid(pyramid, "/path/to/output", mode="w")
create_healpix_pyramid computes the remapping weights on the first run
and takes them from the weights store afterwards.
Where to go next¶
- Getting started: installation, writing to S3 and logging.
- Recipes: worked examples for each kind of source data.
- Technical decisions: why HEALPix, and how remapping, binning, coarsening and the stored metadata work.
- API reference: every public function and class.