apply_extrema_filter#

rojak.atmosphere.regions.apply_extrema_filter(target_data, extrema_kind, latitude_dim_name='latitude', longitude_dim_name='longitude', **filter_kwargs)[source]#

Apply a spatial extrema filter to a 3D DataArray.

Applies either a maximum or minimum filter from scipy.ndimage over the latitude and longitude dimensions of a 3D DataArray, with support for Dask-backed arrays.

Parameters:
Returns:

A DataArray of the same shape and dtype as target_data with the extrema filter applied over the latitude and longitude dimensions.

Return type:

xarray.DataArray

Raises:
  • ValueError – If target_data is not 3D.

  • ValueError – If target_data does not contain the specified latitude and longitude dimensions.