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.
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.classesNumber of output classes (phases) the model produces.
in_channelsNumber of input channels the model expects.
initializedTrueif every state key has been initialised (no...sentinels remain).noverlapNumber of overlapping samples between consecutive segments.
npersegNumber of samples per segment (= model input length).
phasesList of phase label strings produced by the model.
stateDict of the current state, including nested atom states.
stepStride between the start of consecutive segments.