ExtremaPointFeature#
- class rojak.atmosphere.feature_composite.ExtremaPointFeature(field, kind, *, threshold=None, footprint_radius=24, time_dim_name='time', lat_dim_name='latitude', lon_dim_name='longitude')[source]#
Lows or highs: one point feature per extremum of a field, found by
identify_circular_extrema().Each connected component (8-connectivity) of
local_extremain a time step is one centre, so separate extrema with equal values stay separate and a flat extremum spanning several grid cells is one centre (D7). Each centre owns the cells ofextrema_regionswithin the footprint of any pixel of its component for which it is the deepest centre in range, which is the rule that definesextrema_regions, written as a label array (D11). A component is represented by its first pixel in row-major order, and where equally deep centres are in range of a cell, the one with the smallestcentre_idowns it (D19).centre_idis(time_index * n_lats + lat_index) * n_lons + lon_index + 1for the representative pixel, withtime_indexalong the whole time axis. It is unique across chunks without a global count, independent of the chunking, increasing in row-major(time, lat, lon)order, and at least 1, since 0 means “no owner” in the labels.Distances are in grid cells and do not wrap around in longitude, as in the extrema filter’s default boundary mode. Deferred: orientation from a steering flow (phase 5).
- field#
Field to find the extrema in, e.g. mean sea level pressure, with exactly the dimensions
time_dim_name,lat_dim_nameandlon_dim_name. It may be chunked along time; it is rechunked to one chunk in latitude and longitude.- Type:
- kind#
Minima for lows, maxima for highs.
- Type:
- threshold#
Only extrema below (minima) or above (maxima) it are kept.
Nonekeeps all.- Type:
float | None
- footprint_radius#
Radius in grid cells of the circular footprint of the extrema filter, and of the region each centre may own. At least 1.
- Type:
- Raises:
ValueError – If
fielddoes not have exactly the three named dimensions, orfootprint_radiusis below 1.- Parameters:
- __init__(field, kind, *, threshold=None, footprint_radius=24, time_dim_name='time', lat_dim_name='latitude', lon_dim_name='longitude')[source]#
Methods
__init__(field, kind, *[, threshold, ...])chunk_inputs()The field values,
local_extremaandextrema_regions, built lazily without computing anything.tabulator()The parameters-only tabulator sent to each chunk task.
Attributes
geometryEach low or high is a point.
has_labelsThe tabulator labels the region that each centre owns.