Version:

salvus.project.components.waveform_component

salvus.project.components.waveform_component salvus project components waveform_component
The waveform component.

Classes

WaveformComponent

Project subclass handling all things related to waveforms.
SalvusProject refers to waveform data by data type (or namespace if you will) and name within that data type. Everything before the colon is the data type, everything after it the name, e.g. DATA_TYPE:NAME. The NAME part is a user defined string. If no data type/namespace is given it will default to SYNTHETIC_DATA.
SalvusProject distinguishes three data types:
  • SYNTHETIC_DATA: Synthetically computed waveforms. These are always computed within the project structure.
  • EXTERNAL_DATA: Observed or externally computed waveform data.
  • PROCESSED_DATA: Any processed data. The data can originate from synthetic, external or even other processed data but a function sits in between that processed the data in some fashion.
Examples include simulation_5Hz (or equivalently SYNTHETIC_DATA:simulation_5Hz), EXTERNAL_DATA:raw_observed, PROCESSED_DATA:observed_highpass_5Hz, and so on.
Processing fragments are furthermore available to easy application of simple and common processing techniques.
To for example bandpass and normalize some data observed raw data use "EXTERNAL_DATA:raw_data | bandpass(1.0, 2.0) | normalize" as the data name. We recommend to use this largely for exploratory purposes and turn them into a proper processing function for longer-term uses.
Available processing fragments:
  • time_shift({SHIFT})
  • normalize
  • scale({FACTOR})
  • flip
  • bandpass({FREQ_MIN}, {FREQ_MAX}[, zerophase][, corners={CORNERS}])
SIGNATURE
class WaveformComponent(builtins.object):
    def __init__(self, project: salvus.project.Project): ...
ARGUMENTS
Required
project
Type:salvus.project.Project
Description:
The project to attach the waveform component to.

Methods

WaveformComponent.add_external()
Add external waveform data to the project.
SIGNATURE
def add_external(
    self,
    data_name: str,
    event: Event | str,
    data_filename: pathlib.Path | None = None,
    data: xr.Dataset | xr.DataArray | None = None,
    add_receivers_to_project_event: bool = False,
    receiver_fields: list[str] | None = None,
    add_event_to_project: bool = False,
) -> None: ...
ARGUMENTS
Required
data_name
Type:str
Description:
Name of the data set.
Required
event
Type:Event | str
Description:
The event to add it to.
Optional
data_filename
Type:pathlib.Path | None
Default value:None
Description:
The path to the data.
Optional
data
Type:xr.Dataset | xr.DataArray | None
Default value:None
Description:
Alternatively pass the data as an xarray data structure. Either data_filename or data must be set.
Optional
add_receivers_to_project_event
Type:bool
Default value:False
Description:
If this is true, the receivers in the file will be added to the event in the project. This only works if the project does not yet have any receivers. If the event already has receivers
Optional
receiver_fields
Type:list[str] | None
Default value:None
Description:
Receiver fields for the new receivers to be added.
Optional
add_event_to_project
Type:bool
Default value:False
Description:
If True, this will attempt to add the event to project. In this case the event argument must be an Event object.
WaveformComponent.add_external_data_proxy()
Add a data proxy object as external data.
SIGNATURE
def add_external_data_proxy(
    self, data_name: str, data_proxy: EventDataCollectionProxy
) -> None: ...
ARGUMENTS
Required
data_name
Type:str
Description:
Name of the data.
Required
data_proxy
Type:EventDataCollectionProxy
Description:
Data proxy object.
WaveformComponent.get()
Get waveform data.
SIGNATURE
def get(
    self,
    data_name: str,
    events: (
        str
        | typing.Sequence[str]
        | Event
        | typing.Sequence[Event]
        | EventCollection
    ),
    data_selection_configuration: str | None = None,
) -> EventDataCollection: ...
ARGUMENTS
Required
data_name
Type:str
Description:
Data source name.
Required
events
Type:str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection
Description:
One or more events.
Optional
data_selection_configuration
Type:str | None
Default value:None
Description:
Name of the optionally to be applied data selection configuration. If given it will be applied to the data.
WaveformComponent.has_data()
Figure out if an event has a certain piece of waveform data.
SIGNATURE
def has_data(self, data_name: str, event: str | Event) -> bool: ...
ARGUMENTS
Required
data_name
Type:str
Description:
The waveform data name.
Required
event
Type:str | Event
Description:
The event to check if it has data for.
WaveformComponent.list_external_data_proxies()
Get a list of external data proxies.
SIGNATURE
def list_external_data_proxies(self) -> list[str]: ...
PAGE CONTENTS