Stalta

class of dascore.transform.stalta
inherits from: PatchProcessor, DascoreBaseModel, pydantic.main.BaseModel
source

Stalta(
    *args ,
    samples: Any = False,
    **kwargs ,
)-> None

Compute the short-term / long-term average (STA/LTA) ratio along a patch dimension.

Parameters

Parameter Description
samples If True, values specified by kwargs are in samples not coordinate units.
**kwargs Used to pass one dimension name and the short/long-term window lengths.
For example time=(0.1, 0.5) uses windows of 0.1 and 0.5 seconds along
the time axis.

Returns

PatchType A new patch containing the STA/LTA ratio.

Note

A good first guess is to choose the long-term window 5x the length of the short-term window.

Examples

import dascore as dc

p = dc.examples.example_event_2()

s = p.envelope(dim="time").stalta(time=(0.002, 0.01))
s.viz.waterfall(  # doctest: +SKIP
    cmap="RdGy_r", scale=[0, 2], scale_type="absolute"
);

Methods

Name Description
check Refuse a patch which does not carry what the operation needs.
chunk_contract Return what a chunk of the output needs of the input, or None.
get_metadata Return the ratio’s metadata, and each window and how it is rolled.
model_copy Copy the model, dropping cached values the update invalidates.
new Create new instance with some attributed updated.
numpy_kernel Return the short-term rolling mean over the long-term one.
stalta Compute the short-term / long-term average (STA/LTA) ratio along a patch dimension.
reconcile Return metadata or a patch holding the final data; default as is.
run Run the operation: check, get_metadata, kernel, reconcile, record.