xdas.atoms.DownSample#

class xdas.atoms.DownSample(factor, dim='last')[source]#

Stateful integer downsampling by selecting every factor-th sample.

Parameters:
  • factor (int) – Downsampling factor.

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

__init__(factor, dim='last')[source]#

Methods

__init__(factor[, dim])

call(da, **flags)

Downsample da, buffering the trailing partial stride when chunked.

initialize(da[, chunk_dim])

Initialise the carry-over buffer for chunked operation.

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.