pylawr.transform#

pylawr.transform.memorymixin.MemoryMixin()

Abstract base class for dynamic filters (e.g.

pylawr.transform.transformer.Transformer()

Abstract base class for transformers, which apply filters or other operations on RadarField

pylawr.transform.memorymixin.MemoryMixin#

class pylawr.transform.memorymixin.MemoryMixin[source]#

Bases: ABC

Abstract base class for dynamic filters (e.g. static clutter or noise is dependent of the recent states)

_abc_impl = <_abc._abc_data object>#
static _get_time(array, time_obj=None)[source]#

Get the time from array or given time_obj.

Parameters
  • array (array-like) – The linear reflectivity \(Z\)

  • time_obj (datetime.datetime, numpy.datetime64 or None) – The time array was recorded. If None, the time will be determined from array.time, if available, otherwise it will be set to datetime.datetime.now. Default is None.

Returns

time_obj – The time from given time_obj or determined automatically as numpy.datetime64 object.

Return type

numpy.datetime64

abstract fit(*args, **kwargs)[source]#

Fit the filter to a new state

abstract property fitted#
classmethod from_xarray(ds)[source]#

Create a filter from a given parameters dataset.

Parameters

ds (xarray.Dataset) – a filter parameters dataset

Returns

the filter with the specified parameters

Return type

Filter

reset()[source]#

Reset the trainable values of this filter. The trainable values will be set to their default value.

set_xr_params(ds)[source]#

The parameters from an xarray dataset are read and converted into attributes of this filter.

Parameters

ds (xarray.Dataset) – the filter parameters

abstract to_xarray()[source]#

Serialize this filter’s parameters to an xarray.Dataset

Returns

the filter’s parameters as dataset

Return type

xarray.Dataset

pylawr.transform.transformer.Transformer#

class pylawr.transform.transformer.Transformer[source]#

Bases: ABC

Abstract base class for transformers, which apply filters or other operations on RadarField

_abc_impl = <_abc._abc_data object>#
abstract transform(array, grid=None, *args, **kwargs)[source]#

Transform a given array with an optional grid according to the parameters.

Parameters
  • array (xarray.DataArray) – The array to operate on.

  • grid (child of pylawr.grid.base.BaseGrid, optional) – The grid to use. If left unspecified, array.lawr.grid is used.

  • args (sequence) – Further positional arguments

  • kwargs (dict) – Further keyword arguments

Returns

The transformed array

Return type

xarray.DataArray