Version:

salvus.flow.simple_config.stf

salvus.flow.simple_config.stf salvus flow simple_config stf
Source time functions.

Functions

parse()

Parse a dictionary or a list of dictionaries to STF objects.
SIGNATURE
def parse(dict_stfs: list[dict] | dict) -> list[_Base]: ...
ARGUMENTS
Required
dict_stfs
Type:list[dict] | dict
Description:
Parse a list of source time functions (or just a single one as a dictionary to the proper objects.
RETURNS
Return type: list[_Base]

Classes

Custom

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
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:
SIGNATURE
class Custom(salvus.flow.simple_config.stf._Base):
    def __init__(self, dataset_name: str, filename: str): ...
ARGUMENTS
Required
dataset_name
Type:str
Description:
The hdf5 dataset name containing the source time function. Example: /stf
Required
filename
Type:str
Description:
The hdf5 filename of the source. Example: source.h5

Class Methods

Custom.from_array()
Create a custom STF by directly passing a numpy array.
SIGNATURE
def from_array(
    array: np.ndarray | list[np.ndarray],
    sampling_rate_in_hertz: float,
    start_time_in_seconds: float = 0.0,
    dataset_name: str = "/stf",
) -> "Custom": ...
ARGUMENTS
Required
array
Type:np.ndarray | list[np.ndarray]
Description:
The array to use as a source time function. Has to have shape [npts, N] where npts is the just the number of time series samples and N is 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.
Required
sampling_rate_in_hertz
Type:float
Description:
The sampling rate in Hz.
Optional
start_time_in_seconds
Type:float
Default value:0.0
Description:
Time of the first sample relative to the simulation start and end times.
Optional
dataset_name
Type:str
Default value:'/stf'
Description:
The dataset name to use.
Custom.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

Custom.apply()
Set the contents with a dictionary.
SIGNATURE
def apply(self, d: dict | _DeepSetter) -> None: ...
ARGUMENTS
Required
d
Type:dict | _DeepSetter
Description:
The dictionary to set.
Custom.copy()
Return a deep copy of the object.
SIGNATURE
def copy(self) -> _DeepSetter: ...
Custom.get_auto_end_time()
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.
SIGNATURE
def get_auto_end_time(self) -> float: ...
Custom.get_auto_start_time()
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.
SIGNATURE
def get_auto_start_time(self) -> float: ...
Custom.get_dictionary()
Get the contents of this object as a dictionary.
SIGNATURE
def get_dictionary(self) -> dict: ...
Custom.get_power_spectrum()
Return the power spectrum for the source time function.
SIGNATURE
def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...
Custom.get_stf()
Get the numerical values for the source time function.
SIGNATURE
def get_stf(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Custom.get_stf_rate()
Get the first time derivative of the source time function.
SIGNATURE
def get_stf_rate(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Custom.plot()
Plot the STF and its power spectrum.
SIGNATURE
def plot(
    self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...
ARGUMENTS
Optional
show
Type:bool
Default value:True
Description:
Show the plot, otherwise return the figure.
Custom.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
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.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
Custom.validate()
Validates the current state of the configuration against its schema.
SIGNATURE
def validate(self) -> None: ...

Delta

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
Delta source time function.
A Dirac pulse emitted at the first time step of the simulation.
SIGNATURE
class Delta(salvus.flow.simple_config.stf._Base):
    def __init__(self): ...

Class Methods

Delta.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

Delta.apply()
Set the contents with a dictionary.
SIGNATURE
def apply(self, d: dict | _DeepSetter) -> None: ...
ARGUMENTS
Required
d
Type:dict | _DeepSetter
Description:
The dictionary to set.
Delta.copy()
Return a deep copy of the object.
SIGNATURE
def copy(self) -> _DeepSetter: ...
Delta.get_auto_end_time()
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.
SIGNATURE
def get_auto_end_time(self) -> float: ...
Delta.get_auto_start_time()
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.
SIGNATURE
def get_auto_start_time(self) -> float: ...
Delta.get_dictionary()
Get the contents of this object as a dictionary.
SIGNATURE
def get_dictionary(self) -> dict: ...
Delta.get_power_spectrum()
Return the power spectrum for the source time function.
SIGNATURE
def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...
Delta.get_stf()
Get the numerical values for the source time function.
SIGNATURE
def get_stf(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Delta.get_stf_rate()
Get the first time derivative of the source time function.
SIGNATURE
def get_stf_rate(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Delta.plot()
Plot the STF and its power spectrum.
SIGNATURE
def plot(
    self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...
ARGUMENTS
Optional
show
Type:bool
Default value:True
Description:
Show the plot, otherwise return the figure.
Delta.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
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.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
Delta.validate()
Validates the current state of the configuration against its schema.
SIGNATURE
def validate(self) -> None: ...

FilteredHeaviside

Specialized custom source time function for filtered heaviside.
SIGNATURE
class 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: float | None = None,
    ): ...
ARGUMENTS
Required
end_time_in_seconds
Type:float
Description:
End time of source wavelet.
Required
min_frequency_in_hertz
Type:float
Description:
Minimum frequency for high pass filter.
Required
max_frequency_in_hertz
Type:float
Description:
Maximum frequency for low pass filter.
Optional
start_time_in_seconds
Type:float
Default value:0.0
Description:
Start time of source wavelet.
Optional
highpass_corners
Type:int
Default value:3
Description:
High pass filter corners / order.
Optional
lowpass_corners
Type:int
Default value:3
Description:
Low pass filter corners / order.
Optional
zerophase
Type:bool
Default value:False
Description:
If True, apply filter once forwards and once backwards.
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
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.

FlatSpectrumWavelet

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.
SIGNATURE
class 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,
    ): ...
ARGUMENTS
Required
f0
Type:float
Description:
Lowest desired frequency (in hertz).
Required
f1
Type:float
Description:
Low end of flat range (in hertz).
Required
f2
Type:float
Description:
High end of flat range (in hertz).
Required
f3
Type:float
Description:
Highest desired frequency (in hertz).
Optional
time_shift_in_seconds
Type:float
Default value:0.0
Description:
Shift the center of the wavelet by this amount in seconds. Defaults to 0.0.

GaussianRate

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
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
s(t)=12+1πt0texp(α(tt0)τ)2dξ,s(t) = \frac{1}{2} + \frac{1}{\sqrt{\pi}} \int_{t_0}^{t} \exp{ \left(- \frac{\alpha (t - t_0)}{\tau} \right)^2} \,d\xi,
where
  • tt is the current time,
  • t0t_0 is an optional time shift (default: 0.0),
  • α\alpha is the decay rate (default 3.5), and
  • τ\tau is the half duration.
Hence, the first time derivative is a Gaussian given by
s(t)=ατπexp(α(ξt0)τ)2.s(t)' = \frac{\alpha}{\tau\sqrt{\pi}} \exp{ \left(- \frac{\alpha (\xi - t_0)}{\tau} \right)^2}.
Here is an example:
SIGNATURE
class GaussianRate(salvus.flow.simple_config.stf._Base):
    def __init__(
        self,
        half_duration_in_seconds: float,
        time_shift_in_seconds: typing.Optional[float] = None,
        decay_rate: typing.Optional[float] = None,
    ): ...
ARGUMENTS
Required
half_duration_in_seconds
Type:float
Description:
The half duration Example: 1.0
Optional
time_shift_in_seconds
Type:typing.Optional[float]
Default value:None
Description:
Optional time shift to center the ricker wavelet around a time different than zero. Example: 1.0
Optional
decay_rate
Type:typing.Optional[float]
Default value:None
Description:
The source decay rate. Default: 3.5 Example: 3.5

Class Methods

GaussianRate.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

GaussianRate.apply()
Set the contents with a dictionary.
SIGNATURE
def apply(self, d: dict | _DeepSetter) -> None: ...
ARGUMENTS
Required
d
Type:dict | _DeepSetter
Description:
The dictionary to set.
GaussianRate.copy()
Return a deep copy of the object.
SIGNATURE
def copy(self) -> _DeepSetter: ...
GaussianRate.get_auto_end_time()
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.
SIGNATURE
def get_auto_end_time(self) -> float: ...
GaussianRate.get_auto_start_time()
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.
SIGNATURE
def get_auto_start_time(self) -> float: ...
GaussianRate.get_dictionary()
Get the contents of this object as a dictionary.
SIGNATURE
def get_dictionary(self) -> dict: ...
GaussianRate.get_power_spectrum()
Return the power spectrum for the source time function.
SIGNATURE
def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...
GaussianRate.get_stf()
Get the numerical values for the source time function.
SIGNATURE
def get_stf(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
GaussianRate.get_stf_rate()
Get the first time derivative of the source time function.
SIGNATURE
def get_stf_rate(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
GaussianRate.plot()
Plot the STF and its power spectrum.
SIGNATURE
def plot(
    self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...
ARGUMENTS
Optional
show
Type:bool
Default value:True
Description:
Show the plot, otherwise return the figure.
GaussianRate.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
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.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
GaussianRate.validate()
Validates the current state of the configuration against its schema.
SIGNATURE
def validate(self) -> None: ...

Heaviside

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
Heaviside source time function.
s(t)={1tt0,0else,s(t) = \left\{ \begin{array}{cl} 1 & t \geq t_0, \\ 0 & \text{else} \end{array}\right.,
where
  • tt is the current time,
  • t0t_0 is an optional time shift (default: 0.0).
SIGNATURE
class Heaviside(salvus.flow.simple_config.stf._Base):
    def __init__(self): ...

Class Methods

Heaviside.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

Heaviside.apply()
Set the contents with a dictionary.
SIGNATURE
def apply(self, d: dict | _DeepSetter) -> None: ...
ARGUMENTS
Required
d
Type:dict | _DeepSetter
Description:
The dictionary to set.
Heaviside.copy()
Return a deep copy of the object.
SIGNATURE
def copy(self) -> _DeepSetter: ...
Heaviside.get_auto_end_time()
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.
SIGNATURE
def get_auto_end_time(self) -> float: ...
Heaviside.get_auto_start_time()
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.
SIGNATURE
def get_auto_start_time(self) -> float: ...
Heaviside.get_dictionary()
Get the contents of this object as a dictionary.
SIGNATURE
def get_dictionary(self) -> dict: ...
Heaviside.get_power_spectrum()
Return the power spectrum for the source time function.
SIGNATURE
def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...
Heaviside.get_stf()
Get the numerical values for the source time function.
SIGNATURE
def get_stf(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Heaviside.get_stf_rate()
Get the first time derivative of the source time function.
SIGNATURE
def get_stf_rate(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Heaviside.plot()
Plot the STF and its power spectrum.
SIGNATURE
def plot(
    self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...
ARGUMENTS
Optional
show
Type:bool
Default value:True
Description:
Show the plot, otherwise return the figure.
Heaviside.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
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.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
Heaviside.validate()
Validates the current state of the configuration against its schema.
SIGNATURE
def validate(self) -> None: ...

Ormsby

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.
SIGNATURE
class 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,
    ): ...
ARGUMENTS
Required
f0
Type:float
Description:
Lowest desired frequency (in hertz).
Required
f1
Type:float
Description:
Low end of flat range (in hertz).
Required
f2
Type:float
Description:
High end of flat range (in hertz).
Required
f3
Type:float
Description:
Highest desired frequency (in hertz).
Optional
time_shift_in_seconds
Type:float
Default value:0.0
Description:
Shift the center of the wavelet by this amount in seconds. Defaults to 0.0.

Ricker

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
Ricker source time function.
The Ricker wavelet is the second derivative of a Gaussian, and defined as
s(t)=(12(tt0)2π2ω2)exp((tt0)2π2ω2),s(t) = \left(1 - 2\,(t-t_0)^2\,\pi^2\,\omega^2\right) \, \exp\left(-(t-t_0)^2\,\pi^2\,\omega^2\right),
where
  • tt is the current time,
  • t0t_0 is an optional time shift (default: 0.0), and
  • ω\omega is the center frequency.
Here is an example:
SIGNATURE
class Ricker(salvus.flow.simple_config.stf._Base):
    def __init__(
        self,
        center_frequency: float,
        time_shift_in_seconds: typing.Optional[float] = None,
    ): ...
ARGUMENTS
Required
center_frequency
Type:float
Description:
The center frequency of the ricker wavelet. Example: 1.0
Optional
time_shift_in_seconds
Type:typing.Optional[float]
Default value:None
Description:
Optional time shift to center the ricker wavelet around a time different than zero. Example: 1.0

Class Methods

Ricker.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

Ricker.apply()
Set the contents with a dictionary.
SIGNATURE
def apply(self, d: dict | _DeepSetter) -> None: ...
ARGUMENTS
Required
d
Type:dict | _DeepSetter
Description:
The dictionary to set.
Ricker.copy()
Return a deep copy of the object.
SIGNATURE
def copy(self) -> _DeepSetter: ...
Ricker.get_auto_end_time()
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.
SIGNATURE
def get_auto_end_time(self) -> float: ...
Ricker.get_auto_start_time()
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.
SIGNATURE
def get_auto_start_time(self) -> float: ...
Ricker.get_dictionary()
Get the contents of this object as a dictionary.
SIGNATURE
def get_dictionary(self) -> dict: ...
Ricker.get_power_spectrum()
Return the power spectrum for the source time function.
SIGNATURE
def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...
Ricker.get_stf()
Get the numerical values for the source time function.
SIGNATURE
def get_stf(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Ricker.get_stf_rate()
Get the first time derivative of the source time function.
SIGNATURE
def get_stf_rate(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Ricker.plot()
Plot the STF and its power spectrum.
SIGNATURE
def plot(
    self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...
ARGUMENTS
Optional
show
Type:bool
Default value:True
Description:
Show the plot, otherwise return the figure.
Ricker.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
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.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
Ricker.validate()
Validates the current state of the configuration against its schema.
SIGNATURE
def validate(self) -> None: ...

Ricker1stDerivative

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
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:
SIGNATURE
class Ricker1stDerivative(salvus.flow.simple_config.stf._Base):
    def __init__(
        self,
        center_frequency: float,
        time_shift_in_seconds: typing.Optional[float] = None,
    ): ...
ARGUMENTS
Required
center_frequency
Type:float
Description:
The center frequency of the ricker wavelet. Example: 1.0
Optional
time_shift_in_seconds
Type:typing.Optional[float]
Default value:None
Description:
Optional time shift to center the ricker wavelet around a time different than zero. Example: 1.0

Class Methods

Ricker1stDerivative.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

Ricker1stDerivative.apply()
Set the contents with a dictionary.
SIGNATURE
def apply(self, d: dict | _DeepSetter) -> None: ...
ARGUMENTS
Required
d
Type:dict | _DeepSetter
Description:
The dictionary to set.
Ricker1stDerivative.copy()
Return a deep copy of the object.
SIGNATURE
def copy(self) -> _DeepSetter: ...
Ricker1stDerivative.get_auto_end_time()
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.
SIGNATURE
def get_auto_end_time(self) -> float: ...
Ricker1stDerivative.get_auto_start_time()
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.
SIGNATURE
def get_auto_start_time(self) -> float: ...
Ricker1stDerivative.get_dictionary()
Get the contents of this object as a dictionary.
SIGNATURE
def get_dictionary(self) -> dict: ...
Ricker1stDerivative.get_power_spectrum()
Return the power spectrum for the source time function.
SIGNATURE
def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...
Ricker1stDerivative.get_stf()
Get the numerical values for the source time function.
SIGNATURE
def get_stf(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Ricker1stDerivative.get_stf_rate()
Get the first time derivative of the source time function.
SIGNATURE
def get_stf_rate(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Ricker1stDerivative.plot()
Plot the STF and its power spectrum.
SIGNATURE
def plot(
    self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...
ARGUMENTS
Optional
show
Type:bool
Default value:True
Description:
Show the plot, otherwise return the figure.
Ricker1stDerivative.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
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.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
Ricker1stDerivative.validate()
Validates the current state of the configuration against its schema.
SIGNATURE
def validate(self) -> None: ...

Ricker2ndDerivative

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
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:
SIGNATURE
class Ricker2ndDerivative(salvus.flow.simple_config.stf._Base):
    def __init__(
        self,
        center_frequency: float,
        time_shift_in_seconds: typing.Optional[float] = None,
    ): ...
ARGUMENTS
Required
center_frequency
Type:float
Description:
The center frequency of the ricker wavelet. Example: 1.0
Optional
time_shift_in_seconds
Type:typing.Optional[float]
Default value:None
Description:
Optional time shift to center the ricker wavelet around a time different than zero. Example: 1.0

Class Methods

Ricker2ndDerivative.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

Ricker2ndDerivative.apply()
Set the contents with a dictionary.
SIGNATURE
def apply(self, d: dict | _DeepSetter) -> None: ...
ARGUMENTS
Required
d
Type:dict | _DeepSetter
Description:
The dictionary to set.
Ricker2ndDerivative.copy()
Return a deep copy of the object.
SIGNATURE
def copy(self) -> _DeepSetter: ...
Ricker2ndDerivative.get_auto_end_time()
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.
SIGNATURE
def get_auto_end_time(self) -> float: ...
Ricker2ndDerivative.get_auto_start_time()
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.
SIGNATURE
def get_auto_start_time(self) -> float: ...
Ricker2ndDerivative.get_dictionary()
Get the contents of this object as a dictionary.
SIGNATURE
def get_dictionary(self) -> dict: ...
Ricker2ndDerivative.get_power_spectrum()
Return the power spectrum for the source time function.
SIGNATURE
def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...
Ricker2ndDerivative.get_stf()
Get the numerical values for the source time function.
SIGNATURE
def get_stf(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Ricker2ndDerivative.get_stf_rate()
Get the first time derivative of the source time function.
SIGNATURE
def get_stf_rate(
    self,
    sampling_rate_in_hertz: float | None = None,
    start_time_in_seconds: float | None = None,
    end_time_in_seconds: float | None = None,
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Optional
sampling_rate_in_hertz
Type:float | None
Default value:None
Description:
Sampling rate. If not given, it will be computed automatically.
Optional
start_time_in_seconds
Type:float | None
Default value:None
Description:
The start time. If not given, it will be computed automatically.
Optional
end_time_in_seconds
Type:float | None
Default value:None
Description:
The end time. If not given, it will be computed automatically.
Ricker2ndDerivative.plot()
Plot the STF and its power spectrum.
SIGNATURE
def plot(
    self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...
ARGUMENTS
Optional
show
Type:bool
Default value:True
Description:
Show the plot, otherwise return the figure.
Ricker2ndDerivative.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
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.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.
Ricker2ndDerivative.validate()
Validates the current state of the configuration against its schema.
SIGNATURE
def validate(self) -> None: ...

ToneBurst

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.
SIGNATURE
class 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,
    ): ...
ARGUMENTS
Required
center_frequency
Type:float
Description:
The center frequency of the tone burst in Hertz.
Required
num_cycles
Type:int
Description:
The number of cycles to inject at center_frequency.
Optional
num_ramp_up_cycles
Type:int
Default value:2
Description:
Apply a shifted cosine taper to slowly ramp up to the full amplitude over this many cycles. Defaults to 2.
Optional
num_ramp_down_cycles
Type:int
Default value:2
Description:
Apply a shifted cosine taper to slowly ramp down at the end of the burst over this many cycles. Defaults to 2.
Optional
time_shift_in_seconds
Type:float
Default value:0.0
Description:
Shift the beginning of the burst by this amount. Defaults to 0.0.
Optional
allow_overlapping_ramp
Type:bool
Default value:False
Description:
If this is True, and if num_ramp_up_cycles + num_ramp_down_cycles is greater than num_cycles, a ValueError will be thrown.

Used in tutorials

Functionality from this module is used in the following tutorials.
PAGE CONTENTS