xdas.atoms.SOSFilter#

class xdas.atoms.SOSFilter(sos, dim='last', parallel=None)[source]#

Stateful second-order-sections IIR filter using scipy.signal.sosfilt().

Parameters:
  • sos (array-like, shape (n_sections, 6)) – SOS filter coefficients as returned by e.g. scipy.signal.iirfilter().

  • dim (str or int, optional) – Dimension to filter along. Defaults to "last".

  • parallel (int, bool, or None, optional) – Worker count for parallelisation.

__init__(sos, dim='last', parallel=None)[source]#

Methods

__init__(sos[, dim, parallel])

call(da, **flags)

Apply the SOS filter to da, updating the state if chunked.

initialize(da[, chunk_dim])

Set the filter axis and allocate the SOS initial-conditions buffer.

initialize_from_state()

Initialise the atom from its current state.

load_state(path)

Load the atom state from the NetCDF4 file at path.

reset()

Reset all state entries to ... (uninitialised sentinel).

save_state(path)

Serialise the current state to a NetCDF4 file at path.

set_state(state)

Restore the atom state from a previously saved state dict.

Attributes

initialized

True if every state key has been initialised (no ... sentinels remain).

state

Dict of the current state, including nested atom states.