xdas.atoms#

Base Atom class#

Constructor

Atom()

The base class for atoms.

Attributes

Atom.state

Dict of the current state, including nested atom states.

Atom.initialized

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

Methods

Atom.initialize(x, **flags)

Initialise the atom from a first chunks of data.

Atom.initialize_from_state()

Initialise the atom from its current state.

Atom.call(x, **flags)

Process a chunk of data.

Atom.reset()

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

Atom.save_state(path)

Serialise the current state to a NetCDF4 file at path.

Atom.set_state(state)

Restore the atom state from a previously saved state dict.

Atom.load_state(path)

Load the atom state from the NetCDF4 file at path.

Core atoms#

Sequential(atoms[, name])

A class to handle a sequence of operations.

State(state)

A class to declare a new state or to update a preexising one into an Atom object.

Partial#

Partial(func, *args[, name])

Wraps a function into an Atom.

Attributes

Partial.stateful

True if any keyword argument is being passed as state.

Methods

Partial.call(x, **flags)

Call the wrapped function with x substituted at the ... position.

Partial.from_state(state)

Reconstruct a Partial from a serialised state dict.

Partial.get_state()

Return a JSON-serialisable dict describing the wrapped function and args.

Decorators#

atomized(func)

Make the function return an Atom if ... or an atom is passed as argument.

Signal processing#

DownSample(factor[, dim])

Stateful integer downsampling by selecting every factor-th sample.

FIRFilter(numtaps, cutoff[, btype, window, ...])

Pipeline implementation of an FIR filter.

IIRFilter(order, cutoff[, btype, ftype, ...])

Pipeline implementation of an IIR filter.

LFilter(b, a[, dim, parallel])

Stateful direct-form IIR/FIR filter using scipy.signal.lfilter().

MLPicker(model, dim[, device, ...])

Wraps a SeisBench phase-picking model as a streaming Atom.

ResamplePoly(target[, maxfactor, window, dim])

Pipeline implementation of polyphase-filter resampling.

SOSFilter(sos[, dim, parallel])

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

Trigger(thresh[, dim])

Find picks in a data array along a given axis based on a given threshold.

UpSample(factor[, scale, dim])

Integer upsampling by zero-insertion (and optional energy scaling).