xdas.atoms.MLPicker#

class xdas.atoms.MLPicker(model, dim, device=None, component_strategy='clone')[source]#

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

Uses an overlapping sliding-window strategy to apply the model to arbitrarily long data and to stitch the per-segment probability outputs back into a continuous DataArray.

Parameters:
  • model (seisbench.models.WaveformModel) – A SeisBench model in evaluation mode (will be moved to device).

  • dim (str) – Dimension name along which the model slides (usually "time").

  • device (str or torch.device, optional) – Torch device. Defaults to CUDA if available, else CPU.

  • component_strategy (str, optional) – How to fill the channel dimension: "clone" replicates the single-component signal, or pass a component letter to select it.

__init__(model, dim, device=None, component_strategy='clone')[source]#

Methods

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

call(da, **flags)

Run the model over da, managing a carry-over buffer for chunked input.

initialize(da[, chunk_dim])

Allocate circular buffers sized to da's batch and segment dimensions.

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

blinding

(left, right) blinding samples from the model's default args.

classes

Number of output classes (phases) the model produces.

in_channels

Number of input channels the model expects.

initialized

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

noverlap

Number of overlapping samples between consecutive segments.

nperseg

Number of samples per segment (= model input length).

phases

List of phase label strings produced by the model.

state

Dict of the current state, including nested atom states.

step

Stride between the start of consecutive segments.