salvus.project.components.waveform_component
salvus.project.components.waveform_component salvus project components waveform_component The waveform component.
Classes
WaveformComponent
WaveformComponentclass WaveformComponent(builtins.object):
def __init__(self, project: salvus.project.Project): ...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})normalizescale({FACTOR})flipbandpass({FREQ_MIN}, {FREQ_MAX}[, zerophase][, corners={CORNERS}])
projectsalvus.project.Project — The project to attach the waveform component to.
add_external()
add_external()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: ...Add external waveform data to the project.
data_namestr — Name of the data set.eventEvent | str — The event to add it to.data_filenamepathlib.Path | None — The path to the data.dataxr.Dataset | xr.DataArray | None — Alternatively pass the data as an xarray data structure. Eitherdata_filenameordatamust be set.add_receivers_to_project_eventbool — 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 receiversreceiver_fieldslist[str] | None — Receiver fields for the new receivers to be added.add_event_to_projectbool — If True, this will attempt to add the event to project. In this case theeventargument must be anEventobject.
add_external_data_proxy()
add_external_data_proxy()def add_external_data_proxy(
self, data_name: str, data_proxy: EventDataCollectionProxy
) -> None: ...Add a data proxy object as external data.
data_namestr — Name of the data.data_proxyEventDataCollectionProxy — Data proxy object.
get()
get()def get(
self,
data_name: str,
events: (
str
| typing.Sequence[str]
| Event
| typing.Sequence[Event]
| EventCollection
),
data_selection_configuration: str | None = None,
) -> EventDataCollection: ...Get waveform data.
data_namestr — Data source name.eventsstr | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection — One or more events.data_selection_configurationstr | None — Name of the optionally to be applied data selection configuration. If given it will be applied to the data.
has_data()
has_data()def has_data(self, data_name: str, event: str | Event) -> bool: ...Figure out if an event has a certain piece of waveform data.
data_namestr — The waveform data name.eventstr | Event — The event to check if it has data for.
list_external_data_proxies()
list_external_data_proxies()def list_external_data_proxies(self) -> list[str]: ...Get a list of external data proxies.
Used in tutorials
- 2-D Global-scale simulations w/ heterogeneous models
- Acoustic simulations in isotropic and anisotropic media
- Conical Pitting
- Continental Scale FWI Tutorial - Part 1: Project Setup & Data Acquisition
- Creating and plotting custom gathers from Salvus' receiver outputs
- Equivalence of Filtering STFs and Filtering Synthetics
- Full-Waveform Inversion
- Full-Waveform Inversion
- How to combine (fuse) measured and simulated data in Salvus
- Importing SEGY Data into SalvusProject
- Lamb's problem
- Lamb's problem
- Lamb's problem
- Mapping between simulation and inversion space
- Marmousi Model