regionate¶
Create xgcm-grid-consistent regional masks and boundaries for ocean model output.
regionate turns a geographic polygon into a discrete, grid-aware region: it
snaps the polygon to a model grid and produces a boolean cell mask plus the
staggered (u, v) velocity faces that trace the region’s boundary. Because
the mask and the boundary faces come from the same construction, a volume, mass,
or heat budget integrated over the masked region is exactly consistent with the
fluxes through its boundary — the property that makes closed regional budgets
possible.
It leans on its sibling package
sectionate for the
section- and face-tracing math, and builds on
xgcm grids.
The central object is GriddedRegion (a polygon bound to an xgcm.Grid);
BoundedRegion defines a region from named sections instead of a raw polygon,
and Regions collects many of them. See the worked examples below for thickness,
heat, and mass budgets over named regions.
Contents
- Installation
- Horizontal convergence of thickness fluxes
- Horizontal convergence of vertically-integrated heat fluxes
- Corner case: bipolar grid fold
- 0. Load data
- 1. Determine a mask for the region of interest.
- 2. We use
regionateto find the sections that bound the region - 3. We use
sectionateto compute the advective heat fluxes that converge into the region. - 4. We verify our calculation by comparing against the volume integral of the masked tendency terms
- 5. The pay-off: understanding advective tendencies by tracing them back to boundary fluxes
- Regions bounded by a series of named sections
- Contributor guide
- API reference