pvtend.classify.classify_z_field
- pvtend.classify.classify_z_field(z2d: ndarray, x_rel: ndarray, y_rel: ndarray, cfg: RWBConfig | None = None) tuple[bool, bool][source]
Classify AWB / CWB Rossby-wave-breaking bays on one 2-D Z field.
Public, side-effect-free wrapper around the internal bay-overturning detector
_classify_bays_z2d(). Intended for callers that already hold a single 2-D geopotential-height patch — e.g. the weighted-average Z(300/250/200) “single-field, threshold=1” classification used outside the per-event NPZ tree (other grids/datasets, precomputed patch arrays).- Parameters:
z2d – 2-D geopotential-height field
(NY, NX)[m] on a block- or event-relative grid. NaNs (e.g. polar padding) are tolerated; an all-NaN field returns(False, False).x_rel – Relative longitudes — 1-D
(NX,)or 2-D(NY, NX).y_rel – Relative latitudes — 1-D
(NY,)or 2-D(NY, NX), ascending (north at top).cfg –
RWBConfig;Noneuses theRWBConfig()dataclass defaults (area_min_deg2=30, try_levels=300). Note thepvtend-pipeline classifyCLI tunes these toarea_min_deg2=20, try_levels=400for ERA5; pass an explicitcfgto reproduce that.
- Returns:
(is_awb, is_cwb)— bothTruewhen the field exhibits both an anticyclonic and a cyclonic overturning bay (an Omega block); seelabel_from_flags()to collapse to a single class string.