dug_seis.waveform_handler.waveform_handler module#
Object used to orchestrate, cache, and facilitate waveform access within DUGSeis.
- class dug_seis.waveform_handler.waveform_handler.WaveformHandler(waveform_folders: List[Path], cache_folder: Path, index_sampling_rate_in_hz: int, start_time: UTCDateTime, end_time: UTCDateTime, existing_caches: Optional[Dict] = None)#
Bases:
object
Central class handling waveform access for DUGseis.
- Parameters:
waveform_folders – Folders containing the waveforms as ASDF files.
cache_folder – Some information about the files must be cached. Store that information here.
index_sampling_rate_in_hz – The desired sampling rate of the waveform index.
start_time – Limit temporal range.
end_time – Limit temporal range.
existing_caches – List of already read caches.
- property endtime: UTCDateTime#
Time of the last sample.
- get_binned_index_data(channel_id: str) Tuple[ndarray, ndarray] #
Get the min-max binned data for a certain index.
Return timestamps, bins ready for plotting.
- Parameters:
channel_id – Id of the channel to get.
- get_waveform_data(channel_id: str, start_time: UTCDateTime, end_time: UTCDateTime, npts: int, return_trace: bool = False)#
Lower level waveform access. Please use the
.get_waveforms()
method instead.
- get_waveforms(channel_ids: List[str], start_time: UTCDateTime, end_time: UTCDateTime) Stream #
Retrieve waveforms as an ObsPy Stream objects.
- Parameters:
channel_ids – List of channel ids.
start_time – The start time of the requested data.
end_time – The end time of the requested data.
- property starttime: UTCDateTime#
Time of the first sample.