pylawr.transform#
Abstract base class for dynamic filters (e.g. |
|
Abstract base class for transformers, which apply filters or other operations on RadarField |
pylawr.transform.memorymixin.MemoryMixin#
- class pylawr.transform.memorymixin.MemoryMixin[source]#
Bases:
ABCAbstract 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
arraywas recorded. If None, the time will be determined fromarray.time, if available, otherwise it will be set todatetime.datetime.now. Default is None.
- Returns
time_obj – The time from given time_obj or determined automatically as numpy.datetime64 object.
- Return type
- 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
pylawr.transform.transformer.Transformer#
- class pylawr.transform.transformer.Transformer[source]#
Bases:
ABCAbstract 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
arraywith an optionalgridaccording 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.gridis used.args (sequence) – Further positional arguments
kwargs (dict) – Further keyword arguments
- Returns
The transformed array
- Return type