Waveforms Component

When waveforms are requested and you for example need the same waveform for data and synthetics. The Waveforms component handles your requests.

Contents:

class lasif.components.waveforms.LimitedSizeDict(*args, **kwds)[source]

Based on http://stackoverflow.com/a/2437645/1657047

class lasif.components.waveforms.WaveformsComponent(data_folder, preproc_data_folder, synthetics_folder, communicator, component_name)[source]

Component managing the waveform data.

The LASIF-HP branch can only deal with ASDF files so all waveform data is expected to be in this format.

Parameters
  • data_folder (pathlib.Path) – The data folder in a LASIF project.

  • synthetics_folder (pathlib.Path) – The synthetics folder in a LASIF project.

  • communicator – The communicator instance.

  • component_name – The name of this component for the communicator.

delete_station_from_raw(event_name: str, station_id: str)[source]

Deletes all information from the raw data file for the given station.

Parameters
  • event_name (str) – The name of the event.

  • station_id (str) – The id of the station in the form NET.STA.

get_asdf_filename(event_name: str, data_type: str, tag_or_iteration: Optional[str] = None)[source]

Returns the filename for an ASDF waveform file.

Parameters
  • event_name (str) – Name of the event.

  • data_type (str) – The type of data, one of "raw", "processed", "synthetic"

  • tag_or_iteration (str, optional) – The processing tag or iteration name if any. Defaults to None

get_available_data(event_name: str, station_id: str)[source]

Returns a dictionary with information about the available data.

Information is specific for a given event and station.

Parameters
  • event_name (str) – The event name.

  • station_id (str) – The station id.

get_available_synthetics(event_name: str)[source]

Returns the available synthetics for a given event.

Parameters

event_name (str) – The event name.

get_waveforms_processed(event_name: str, station_id: str, tag: str)[source]

Gets the processed waveforms for the given event and station as a Stream object.

Parameters
  • event_name (str) – The name of the event.

  • station_id (str) – The id of the station in the form NET.STA.

  • tag (str) – The processing tag.

get_waveforms_processed_on_the_fly(event_name: str, station_id: str)[source]

Gets the processed waveforms for the given event and station as a Stream object.

Parameters
  • event_name (str) – The name of the event.

  • station_id (str) – The id of the station in the form NET.STA.

get_waveforms_raw(event_name: str, station_id: str)[source]

Gets the raw waveforms for the given event and station as a Stream object.

Parameters
  • event_name (str) – The name of the event.

  • station_id (str) – The id of the station in the form NET.STA.

get_waveforms_synthetic(event_name: str, station_id: str, long_iteration_name: str)[source]

Gets the synthetic waveforms for the given event and station as a Stream object.

Parameters
  • event_name (str) – The name of the event.

  • station_id (str) – The id of the station in the form NET.STA.

  • long_iteration_name (str) – The long form of an iteration name.

property preprocessing_tag

Gets the preprocessing tag for the lasif project, since each lasif project assumes a constant frequency this only has to be one tag.

process_data(events: List[str])[source]

Processes all data for a given iteration.

This function works with and without MPI.

Parameters

events (List[str]) – event_ids is a list of events to process in this run. It will process all events if not given.

process_data_on_the_fly(st: obspy.core.stream.Stream, inv: obspy.core.inventory.inventory.Inventory, event_name: str)[source]

Process data on the fly

Parameters
Returns

Processed data

Return type

obspy.core.stream.Stream

process_synthetics(st: obspy.core.stream.Stream, event_name: str, iteration: str)[source]

Process synthetics using the project function.

Parameters
Returns

Processed stream of waveforms

Return type

obspy.core.stream.Stream