salvus.flow.simple_config.stf
Source time functions.
Classes
Custom
Customclass Custom(salvus.flow.simple_config.stf._Base):
def __init__(self, filename: str, dataset_name: str): ...Custom source time function.
This function can be used to model arbitrary source time functions.
The source time function is generated from an equidistantly sampled time series, and automatically resampled to the internally used time step during the simulation.
Here is an example:

filenamestr — The hdf5 filename of the source. Example:source.h5dataset_namestr — The hdf5 dataset name containing the source time function. Example:/stf
from_array()
from_array()def from_array(
array: Union[numpy.ndarray, List[numpy.ndarray]],
sampling_rate_in_hertz: float,
start_time_in_seconds: float = 0.0,
dataset_name: str = "/stf",
) -> Custom: ...Create a custom STF by directly passing a numpy array.
arrayUnion[numpy.ndarray, List[numpy.ndarray]] — The array to use as a source time function. Has to have shape[npts, N]wherenptsis the just the number of time series samples andNis either the number of source components or 1. Can also be the transposed array or a list of arrays - this function does its best to figure out the correct order/shape for running Salvus.sampling_rate_in_hertzfloat — The sampling rate in Hz.start_time_in_secondsfloat — Time of the first sample relative to the simulation start and end times.dataset_namestr — The dataset name to use.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
Delta
Deltaclass Delta(salvus.flow.simple_config.stf._Base):
def __init__(self): ...Delta source time function.
A Dirac pulse emitted at the first time step of the simulation.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
FilteredHeaviside
FilteredHeavisideclass FilteredHeaviside(salvus.flow.simple_config.stf.Custom):
def __init__(
self,
end_time_in_seconds: float,
min_frequency_in_hertz: float,
max_frequency_in_hertz: float,
start_time_in_seconds: float = 0.0,
highpass_corners: int = 3,
lowpass_corners: int = 3,
zerophase: bool = False,
sampling_rate_in_hertz: Optional[float] = None,
): ...Specialized custom source time function for filtered heaviside

end_time_in_secondsfloat — End time of source wavelet.min_frequency_in_hertzfloat — Minimum frequency for high pass filter.max_frequency_in_hertzfloat — Minimum frequency for low pass filter.start_time_in_secondsfloat — End time of source wavelet.highpass_cornersint — High pass filter corners / order.lowpass_cornersint — Low pass filter corners / order.zerophasebool — If True, apply filter once forwards and once backwards.sampling_rate_in_hertzOptional[float] — Optionally specify the sampling rate in Hz for full control. If not given it will default to 100 points cycle measured by the maximum frequency.
from_array()
from_array()def from_array(
array: Union[numpy.ndarray, List[numpy.ndarray]],
sampling_rate_in_hertz: float,
start_time_in_seconds: float = 0.0,
dataset_name: str = "/stf",
) -> Custom: ...Create a custom STF by directly passing a numpy array.
arrayUnion[numpy.ndarray, List[numpy.ndarray]] — The array to use as a source time function. Has to have shape[npts, N]wherenptsis the just the number of time series samples andNis either the number of source components or 1. Can also be the transposed array or a list of arrays - this function does its best to figure out the correct order/shape for running Salvus.sampling_rate_in_hertzfloat — The sampling rate in Hz.start_time_in_secondsfloat — Time of the first sample relative to the simulation start and end times.dataset_namestr — The dataset name to use.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
FlatSpectrumWavelet
FlatSpectrumWaveletclass FlatSpectrumWavelet(salvus.flow.simple_config.stf.Custom):
def __init__(
self,
f0: float,
f1: float,
f2: float,
f3: float,
time_shift_in_seconds: float = 0.0,
): ...Create a source time function with a flattened spectrum.
This type of source is sometimes used in the exploration community as an alternative to a classical Ricker source. Users can specify a set of 4 frequencies: f0, f1, f2, and f3. Frequency components below f0 will be zeroed out, and a cosine “up” ramp will be applied in the frequency domain between f0 and f1. Between f1 and f2 the spectrum is flat, and between f2 and f3 a cosine “down” ramp is again applied in the frequency domain. Frequencies higher than f3 are zeroed out.
As is the case with any finite signal, some ringing will be present in the
frequency spectrum. We recommend using the stf.plot() functionality
(demonstrated below) in order to validate that the behavior of the
generated source is as you expect.

Create a source time function with a flattened spectrum.
f0float — Lowest desired frequency (in hertz).f1float — Low end of flat range (in hertz).f2float — High end of flat range (in hertz).f3float — Highest desired frequency (in hertz).time_shift_in_secondsfloat — Shift the center of the wavelet by this amount in seconds. Defaults to 0.0.
from_array()
from_array()def from_array(
array: Union[numpy.ndarray, List[numpy.ndarray]],
sampling_rate_in_hertz: float,
start_time_in_seconds: float = 0.0,
dataset_name: str = "/stf",
) -> Custom: ...Create a custom STF by directly passing a numpy array.
arrayUnion[numpy.ndarray, List[numpy.ndarray]] — The array to use as a source time function. Has to have shape[npts, N]wherenptsis the just the number of time series samples andNis either the number of source components or 1. Can also be the transposed array or a list of arrays - this function does its best to figure out the correct order/shape for running Salvus.sampling_rate_in_hertzfloat — The sampling rate in Hz.start_time_in_secondsfloat — Time of the first sample relative to the simulation start and end times.dataset_namestr — The dataset name to use.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
GaussianRate
GaussianRateclass GaussianRate(salvus.flow.simple_config.stf._Base):
def __init__(
self,
half_duration_in_seconds: float,
decay_rate: Optional[float] = None,
time_shift_in_seconds: Optional[float] = None,
): ...Gaussian rate source time function.
This source time function models a Gaussian for the first time derivative (corresponding to slip rate or moment rate). This source time function itself is given by the error function
where
- is the current time,
- is an optional time shift (
default: 0.0), - is the decay rate (
default 3.5), and - is the half duration.
Hence, the first time derivative is a Gaussian given by
Here is an example:

half_duration_in_secondsfloat — The half duration Example:1.0decay_rateOptional[float] — The source decay rate. Default: 3.5 Example:3.5time_shift_in_secondsOptional[float] — Optional time shift to center the ricker wavelet around a time different than zero. Example:1.0
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
Heaviside
Heavisideclass Heaviside(salvus.flow.simple_config.stf._Base):
def __init__(self): ...Heaviside source time function.
where
- is the current time,
- is an optional time shift (
default: 0.0).
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
Ormsby
Ormsbyclass Ormsby(salvus.flow.simple_config.stf.Custom):
def __init__(
self,
f0: float,
f1: float,
f2: float,
f3: float,
time_shift_in_seconds: float = 0.0,
): ...Create an Ormsby wavelet.
An Ormsby wavelet is designed to have a trapezoidal frequency spectrum that ramps up between f0 and f1, is flat between f1 and f2, and ramps down between f2 and f3. See https://wiki.seg.org/wiki/Ormsby_wavelet for more details.

Create an Ormsby wavelet.
f0float — Lowest desired frequency (in hertz).f1float — Low end of flat range (in hertz).f2float — High end of flat range (in hertz).f3float — Highest desired frequency (in hertz).time_shift_in_secondsfloat — Shift the center of the wavelet by this amount in seconds. Defaults to 0.0.
from_array()
from_array()def from_array(
array: Union[numpy.ndarray, List[numpy.ndarray]],
sampling_rate_in_hertz: float,
start_time_in_seconds: float = 0.0,
dataset_name: str = "/stf",
) -> Custom: ...Create a custom STF by directly passing a numpy array.
arrayUnion[numpy.ndarray, List[numpy.ndarray]] — The array to use as a source time function. Has to have shape[npts, N]wherenptsis the just the number of time series samples andNis either the number of source components or 1. Can also be the transposed array or a list of arrays - this function does its best to figure out the correct order/shape for running Salvus.sampling_rate_in_hertzfloat — The sampling rate in Hz.start_time_in_secondsfloat — Time of the first sample relative to the simulation start and end times.dataset_namestr — The dataset name to use.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
Ricker
Rickerclass Ricker(salvus.flow.simple_config.stf._Base):
def __init__(
self,
center_frequency: float,
time_shift_in_seconds: Optional[float] = None,
): ...Ricker source time function.
The Ricker wavelet is the second derivative of a Gaussian, and defined as
where
- is the current time,
- is an optional time shift (
default: 0.0), and - is the center frequency.
Here is an example:

center_frequencyfloat — The center frequency of the ricker wavelet. Example:1.0time_shift_in_secondsOptional[float] — Optional time shift to center the ricker wavelet around a time different than zero. Example:1.0
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
Ricker1stDerivative
Ricker1stDerivativeclass Ricker1stDerivative(salvus.flow.simple_config.stf._Base):
def __init__(
self,
center_frequency: float,
time_shift_in_seconds: Optional[float] = None,
): ...Normalized first derivative of the Ricker source time function.
See the docstring of the Ricker source time function for the mathematical formula. This function here additionally normalizes the maximum absolute amplitude to 1.0.
Here is an example:

center_frequencyfloat — The center frequency of the ricker wavelet. Example:1.0time_shift_in_secondsOptional[float] — Optional time shift to center the ricker wavelet around a time different than zero. Example:1.0
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
Ricker2ndDerivative
Ricker2ndDerivativeclass Ricker2ndDerivative(salvus.flow.simple_config.stf._Base):
def __init__(
self,
center_frequency: float,
time_shift_in_seconds: Optional[float] = None,
): ...Normalized second derivative of the Ricker source time function.
See the docstring of the Ricker source time function for the mathematical formula. This function here additionally normalizes the maximum absolute amplitude to 1.0.
Here is an example:

center_frequencyfloat — The center frequency of the ricker wavelet. Example:1.0time_shift_in_secondsOptional[float] — Optional time shift to center the ricker wavelet around a time different than zero. Example:1.0
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.
ToneBurst
ToneBurstclass ToneBurst(salvus.flow.simple_config.stf.Custom):
def __init__(
self,
center_frequency: float,
num_cycles: int,
num_ramp_up_cycles: int = 2,
num_ramp_down_cycles: int = 2,
time_shift_in_seconds: float = 0.0,
allow_overlapping_ramp: bool = False,
): ...Specify a tapered monofrequency tone burst.
This type of source time function is commonly used to simulate ultrasound transducers with a certain resonant frequency. A variable number of sinusoidal cycles can be specified, along with a variable number of cycles over which the amplitude of the burst ramps up and down. Note that use of the ramp necessarily introduces some breadth in the frequency spectrum.

Specify a tapered monofrequency tone burst.
center_frequencyfloat — The center frequency of the tone burst in Hertz.num_cyclesint — The number of cycles to inject atcenter_frequency.num_ramp_up_cyclesint — Apply a shifted cosine taper to slowly ramp up to the full amplitude over this many cycles. Defaults to 2.num_ramp_down_cyclesint — Apply a shifted cosine taper to slowly ramp down at the end of the burst over this many cycles. Defaults to 2.time_shift_in_secondsfloat — Shift the beginning of the burst by this amount. Defaults to 0.0.allow_overlapping_rampbool — If this is True, and ifnum_ramp_up_cycles+num_ramp_down_cyclesis greater thannum_cycles, aValueErrorwill be thrown.
from_array()
from_array()def from_array(
array: Union[numpy.ndarray, List[numpy.ndarray]],
sampling_rate_in_hertz: float,
start_time_in_seconds: float = 0.0,
dataset_name: str = "/stf",
) -> Custom: ...Create a custom STF by directly passing a numpy array.
arrayUnion[numpy.ndarray, List[numpy.ndarray]] — The array to use as a source time function. Has to have shape[npts, N]wherenptsis the just the number of time series samples andNis either the number of source components or 1. Can also be the transposed array or a list of arrays - this function does its best to figure out the correct order/shape for running Salvus.sampling_rate_in_hertzfloat — The sampling rate in Hz.start_time_in_secondsfloat — Time of the first sample relative to the simulation start and end times.dataset_namestr — The dataset name to use.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
apply()
apply()def apply(self, d: Union[Dict, _DeepSetter]) -> None: ...Set the contents with a dictionary.
dUnion[Dict, _DeepSetter] — The dictionary to set.
copy()
copy()def copy(self) -> _DeepSetter: ...Return a deep copy of the object.
get_auto_end_time()
get_auto_end_time()def get_auto_end_time(self) -> float: ...Compute the automatically computed end time for that particular source time function.
If no other end time is specified in the simulation config, that start time will be used.
get_auto_start_time()
get_auto_start_time()def get_auto_start_time(self) -> float: ...Compute the automatically computed start time for that particular source time function.
If no other start time is specified in the simulation config, that start time will be used.
get_dictionary()
get_dictionary()def get_dictionary(self) -> Dict: ...Get the contents of this object as a dictionary.
get_power_spectrum()
get_power_spectrum()def get_power_spectrum(self) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Return the power spectrum for the source time function.
get_stf()
get_stf()def get_stf(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the numerical values for the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.get_stf_rate()
get_stf_rate()def get_stf_rate(
self,
sampling_rate_in_hertz: Optional[float] = None,
start_time_in_seconds: Optional[float] = None,
end_time_in_seconds: Optional[float] = None,
) -> Tuple[numpy.ndarray, numpy.ndarray]: ...Get the first time derivative of the source time function.
sampling_rate_in_hertzOptional[float] — Sampling rate. If not given, it will be computed automatically.start_time_in_secondsOptional[float] — The start time. If not given, it will be computed automatically.end_time_in_secondsOptional[float] — The end time. If not given, it will be computed automatically.
numpy arrays: The time values and the numerical values of the source time function.plot()
plot()def plot(self, show: bool = True) -> Optional[matplotlib.figure.Figure]: ...Plot the STF and its power spectrum.
showbool — Show the plot, otherwise return the figure.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[str] — Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
validate()
validate()def validate(self) -> None: ...Validates the current state of the configuration against its schema.