saul.waveform.units

After response removal, waveform data have physical units. These functions perform various checks and inferences to infer the data kind (e.g., infrasound or seismic) and data physical units (e.g., Pa or m/s) of input waveforms.

saul.waveform.units.get_waveform_units(tr: obspy.Trace) Tuple[str, str | None][source]

Infer the data kind and physical units of an input waveform.

Parameters:

tr (Trace) – Input ObsPy Trace object

Returns:

Tuple of (data_kind, waveform_units) where data_kind (str) is the waveform data kind and waveform_units (str or None) is the inferred physical units of the waveform — None means unknown

Return type:

tuple

Warning

This function is designed to carefully check in multiple places to infer the units of the waveform, but it is not guaranteed to be correct since there are too many weird edge cases! Don’t rely on this function for mission-critical applications!