boa#

Belkin-O’Reilly Algorithm filter.

Based on Belkin & O’Reilly 2009, Journal of Marine Systems 78.

DEFAULT_DIMS: list[Hashable] = ['lat', 'lon']#

Default dimensions names.

Used for Xarray input where the dims argument is None and window_size is not a Mapping.

apply_cmf3(window, invalid, center_x, center_y, output)#

Compiled with Numba

  • Options: nopython: True, nogil: True

  • Signatures:
    • (Array(float32, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True), int64, int64, Array(float32, 2, ‘A’, False, aligned=True)) -> none

    • (Array(float64, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True), int64, int64, Array(float64, 2, ‘A’, False, aligned=True)) -> none

Apply contextual median filter.

Parameters:
boa_dask(input_field, iterations=1, axes=None, **kwargs)#

Apply BOA filter.

Parameters:
  • input_field (Array) – Array to filter.

  • iterations (int) – Number of iterations to apply.

  • axes (Sequence[int] | None) – Indices of the the y/lat and x/lon axes on which to work. If None (default), the last two axes are used.

  • kwargs – See available kwargs for universal functions at Generalized universal function API.

Return type:

Array

boa_numpy(input_field, iterations=1, axes=None, **kwargs)#

Apply BOA filter.

Parameters:
  • input_field (ndarray[_Size, _DT]) – Array to filter.

  • iterations (int) – Number of iterations to apply.

  • axes (Sequence[int] | None) – Indices of the the y/lat and x/lon axes on which to work. If None (default), the last two axes are used.

  • kwargs – See available kwargs for universal functions at Generalized universal function API.

Return type:

ndarray[_Size, _DT]

boa_xarray(input_field, iterations=1, dims=None, **kwargs)#

Apply BOA filter.

Parameters:
  • input_field (DataArray) – Array to filter.

  • iterations (int) – Number of iterations to apply.

  • kwargs – See available kwargs for universal functions at Generalized universal function API.

  • dims (Collection[Hashable] | None) – Names of the dimensions along which to apply the algorithm. Order is irrelevant, no reordering will be made between the two dimensions. If the window_size argument is given as a mapping, its keys are used instead. If not specified, is taken as module-wide variable DEFAULT_DIMS which defaults to {'lat', 'lon'}.

Return type:

DataArray

is_max_at(values, invalid, at)#

Compiled with Numba

  • Options: nopython: True, nogil: True

  • Signatures:
    • (Array(float32, 1, ‘A’, False, aligned=True), Array(bool, 1, ‘A’, False, aligned=True), int64) -> bool

    • (Array(float64, 1, ‘A’, False, aligned=True), Array(bool, 1, ‘A’, False, aligned=True), int64) -> bool

    • (Array(float32, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True), int64) -> bool

    • (Array(float64, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True), int64) -> bool

Return True if maximum value is unique and found at specific index.

This is an argmax equivalent with missing values.

Parameters:
Return type:

bool

is_min_at(values, invalid, at)#

Compiled with Numba

  • Options: nopython: True, nogil: True

  • Signatures:
    • (Array(float32, 1, ‘A’, False, aligned=True), Array(bool, 1, ‘A’, False, aligned=True), int64) -> bool

    • (Array(float64, 1, ‘A’, False, aligned=True), Array(bool, 1, ‘A’, False, aligned=True), int64) -> bool

    • (Array(float32, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True), int64) -> bool

    • (Array(float64, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True), int64) -> bool

Return True if minimum value is unique and found at specific index.

This is an argmin equivalent with missing values.

Parameters:
Return type:

bool

is_peak5(window, invalid)#

Compiled with Numba

  • Options: nopython: True, nogil: True

  • Signatures:
    • (Array(float32, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True)) -> bool

    • (Array(float64, 2, ‘A’, False, aligned=True), Array(bool, 2, ‘A’, False, aligned=True)) -> bool

Return True if central pixel is peak on 4 directions.

Parameters:
Return type:

bool