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_extrema in 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 of extrema_regions within the footprint of any pixel of its component for which it is the deepest centre in range, which is the rule that defines extrema_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 smallest centre_id owns it (D19).

centre_id is (time_index * n_lats + lat_index) * n_lons + lon_index + 1 for the representative pixel, with time_index along 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_name and lon_dim_name. It may be chunked along time; it is rechunked to one chunk in latitude and longitude.

Type:

xarray.DataArray

kind#

Minima for lows, maxima for highs.

Type:

ExtremaKind

threshold#

Only extrema below (minima) or above (maxima) it are kept. None keeps 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:

int

time_dim_name#

Name of the time dimension of field.

Type:

str

lat_dim_name#

Name of the latitude dimension of field.

Type:

str

lon_dim_name#

Name of the longitude dimension of field.

Type:

str

Raises:

ValueError – If field does not have exactly the three named dimensions, or footprint_radius is below 1.

Parameters:
  • field (xr.DataArray)

  • kind (ExtremaKind)

  • threshold (float | None)

  • footprint_radius (int)

  • time_dim_name (str)

  • lat_dim_name (str)

  • lon_dim_name (str)

__init__(field, kind, *, threshold=None, footprint_radius=24, time_dim_name='time', lat_dim_name='latitude', lon_dim_name='longitude')[source]#
Parameters:
  • field (xr.DataArray)

  • kind (ExtremaKind)

  • threshold (float | None)

  • footprint_radius (int)

  • time_dim_name (str)

  • lat_dim_name (str)

  • lon_dim_name (str)

Return type:

None

Methods

__init__(field, kind, *[, threshold, ...])

chunk_inputs()

The field values, local_extrema and extrema_regions, built lazily without computing anything.

tabulator()

The parameters-only tabulator sent to each chunk task.

Attributes

footprint_radius

geometry

Each low or high is a point.

has_labels

The tabulator labels the region that each centre owns.

lat_dim_name

lon_dim_name

threshold

time_dim_name

field

kind