Fbe

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

Fbe(
    *args ,
    window: Any ,
    step: Any = None,
    db: Any = True,
    **kwargs ,
)-> None

Compute the rolling Frequency Band Energy in a window. This is the Root-Mean-Squared (RMS) of the Energy in a Frequency Band (the FBE), and commonly called ‘the waterfall plot’ in DAS-processing. This implementation is a wrapper to DASCore functionality: 1) Apply a ‘pass_filter’ to the patch 2) Apply rolling-function of a window along a coordinate 3) Calculate RMS value

Parameters

Parameter Description
window window length in which to calculate energy (in units of the sampling rate)
step time-step for rolling window. Defaults to original sampling rate, but this
can be used for downsampling of the resulting patch.
See also rolling
db Return patch data in decibel [dB] instead of original units.
Decibel is calculated as 20 * log10( sqrt(mean(x^2)) ).
**kwargs Used to specify the dimension and associated frequency, wavelength, or
equivalent limits. For example time=(1, 100) applies a time-dimension bandpass
of 1-100 Hz. See pass_filter for more details.

Returns

PatchType A new patch containing FBE-RMS traces.

Example

import dascore as dc

p = dc.examples.example_event_2()

fbe_patch = p.fbe(time=(100,200), window = 0.002)
ax = fbe_patch.viz.waterfall(cmap = 'Spectral_r')
_ = ax.set_title('FBE along time-axis')
import dascore as dc

p = dc.examples.get_example_patch('example_event_2')

fbe_patch = p.fbe(distance=(.01,.05), window = 5)
ax = fbe_patch.viz.waterfall(cmap = 'Spectral_r')
_ = ax.set_title('FBE along distance-axis')
# The windows overlap by at least the rolling window, and with a
# step they advance by a multiple of it: 15 ms here, every 0.5 ms.
windows = p.window(time=0.02, overlap=0.005)
fbe_patch = windows.fbe(time=(500, 2000), window=0.002, step=0.0005)

Note
  • The first samples have no whole window behind them and are NaN.
  • In a window of Patch.window those samples are discarded from each window and the rest blended, so the windows must overlap by at least the rolling window, and with a step must advance by a multiple of it. The first samples of the patch are NaN as they are here. Decibels are blended as they are, so where two windows meet the result lies between theirs in decibels.

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 energy’s metadata, the filter and the rolling windows.
halo Return the samples a rolling window reads before the one it fills.
model_copy Copy the model, dropping cached values the update invalidates.
new Create new instance with some attributed updated.
numpy_kernel Return the root-mean-square of the filtered data in each window.
fbe Compute the rolling Frequency Band Energy in a window.
reconcile Return metadata or a patch holding the final data; default as is.
run Run the operation: check, get_metadata, kernel, reconcile, record.