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. |
def parse(dict_stfs: list[dict] | dict) -> list[_Base]: ...| Type: | list[dict] | dict |
| Description: | Parse a list of source time functions (or just a single one as a dictionary to the proper objects. |
list[_Base]class Custom(salvus.flow.simple_config.stf._Base):
def __init__(self, dataset_name: str, filename: str): ...| Type: | str |
| Description: | The hdf5 dataset name containing the source time function. Example: /stf |
| Type: | str |
| Description: | The hdf5 filename of the source. Example: source.h5 |
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": ...| 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. |
| Type: | float |
| Description: | The sampling rate in Hz. |
| Type: | float |
| Default value: | 0.0 |
| Description: | Time of the first sample relative to the simulation start and end times. |
| Type: | str |
| Default value: | '/stf' |
| Description: | The dataset name to use. |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def apply(self, d: dict | _DeepSetter) -> None: ...| Type: | dict | _DeepSetter |
| Description: | The dictionary to set. |
def copy(self) -> _DeepSetter: ...def get_auto_end_time(self) -> float: ...def get_auto_start_time(self) -> float: ...def get_dictionary(self) -> dict: ...def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
def plot(
self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...| Type: | bool |
| Default value: | True |
| Description: | Show the plot, otherwise return the figure. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| 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. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |
def validate(self) -> None: ...class Delta(salvus.flow.simple_config.stf._Base):
def __init__(self): ...def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def apply(self, d: dict | _DeepSetter) -> None: ...| Type: | dict | _DeepSetter |
| Description: | The dictionary to set. |
def copy(self) -> _DeepSetter: ...def get_auto_end_time(self) -> float: ...def get_auto_start_time(self) -> float: ...def get_dictionary(self) -> dict: ...def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
def plot(
self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...| Type: | bool |
| Default value: | True |
| Description: | Show the plot, otherwise return the figure. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| 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. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |
def validate(self) -> None: ...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,
): ...| Type: | float |
| Description: | End time of source wavelet. |
| Type: | float |
| Description: | Minimum frequency for high pass filter. |
| Type: | float |
| Description: | Maximum frequency for low pass filter. |
| Type: | float |
| Default value: | 0.0 |
| Description: | Start time of source wavelet. |
| Type: | int |
| Default value: | 3 |
| Description: | High pass filter corners / order. |
| Type: | int |
| Default value: | 3 |
| Description: | Low pass filter corners / order. |
| Type: | bool |
| Default value: | False |
| Description: | If True, apply filter once forwards and once backwards. |
| 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. |
stf.plot() functionality
(demonstrated below) in order to validate that the behavior of the
generated source is as you expect.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,
): ...| Type: | float |
| Description: | Lowest desired frequency (in hertz). |
| Type: | float |
| Description: | Low end of flat range (in hertz). |
| Type: | float |
| Description: | High end of flat range (in hertz). |
| Type: | float |
| Description: | Highest desired frequency (in hertz). |
| Type: | float |
| Default value: | 0.0 |
| Description: | Shift the center of the wavelet by this amount in seconds. Defaults to 0.0. |
default: 0.0),default 3.5), andclass 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,
): ...| Type: | float |
| Description: | The half duration Example: 1.0 |
| 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 |
| Type: | typing.Optional[float] |
| Default value: | None |
| Description: | The source decay rate. Default: 3.5 Example: 3.5 |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def apply(self, d: dict | _DeepSetter) -> None: ...| Type: | dict | _DeepSetter |
| Description: | The dictionary to set. |
def copy(self) -> _DeepSetter: ...def get_auto_end_time(self) -> float: ...def get_auto_start_time(self) -> float: ...def get_dictionary(self) -> dict: ...def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
def plot(
self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...| Type: | bool |
| Default value: | True |
| Description: | Show the plot, otherwise return the figure. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| 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. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |
def validate(self) -> None: ...default: 0.0).class Heaviside(salvus.flow.simple_config.stf._Base):
def __init__(self): ...def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def apply(self, d: dict | _DeepSetter) -> None: ...| Type: | dict | _DeepSetter |
| Description: | The dictionary to set. |
def copy(self) -> _DeepSetter: ...def get_auto_end_time(self) -> float: ...def get_auto_start_time(self) -> float: ...def get_dictionary(self) -> dict: ...def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
def plot(
self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...| Type: | bool |
| Default value: | True |
| Description: | Show the plot, otherwise return the figure. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| 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. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |
def validate(self) -> None: ...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,
): ...| Type: | float |
| Description: | Lowest desired frequency (in hertz). |
| Type: | float |
| Description: | Low end of flat range (in hertz). |
| Type: | float |
| Description: | High end of flat range (in hertz). |
| Type: | float |
| Description: | Highest desired frequency (in hertz). |
| Type: | float |
| Default value: | 0.0 |
| Description: | Shift the center of the wavelet by this amount in seconds. Defaults to 0.0. |
default: 0.0), andclass Ricker(salvus.flow.simple_config.stf._Base):
def __init__(
self,
center_frequency: float,
time_shift_in_seconds: typing.Optional[float] = None,
): ...| Type: | float |
| Description: | The center frequency of the ricker wavelet. Example: 1.0 |
| 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 |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def apply(self, d: dict | _DeepSetter) -> None: ...| Type: | dict | _DeepSetter |
| Description: | The dictionary to set. |
def copy(self) -> _DeepSetter: ...def get_auto_end_time(self) -> float: ...def get_auto_start_time(self) -> float: ...def get_dictionary(self) -> dict: ...def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
def plot(
self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...| Type: | bool |
| Default value: | True |
| Description: | Show the plot, otherwise return the figure. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| 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. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |
def validate(self) -> None: ...class Ricker1stDerivative(salvus.flow.simple_config.stf._Base):
def __init__(
self,
center_frequency: float,
time_shift_in_seconds: typing.Optional[float] = None,
): ...| Type: | float |
| Description: | The center frequency of the ricker wavelet. Example: 1.0 |
| 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 |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def apply(self, d: dict | _DeepSetter) -> None: ...| Type: | dict | _DeepSetter |
| Description: | The dictionary to set. |
def copy(self) -> _DeepSetter: ...def get_auto_end_time(self) -> float: ...def get_auto_start_time(self) -> float: ...def get_dictionary(self) -> dict: ...def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
def plot(
self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...| Type: | bool |
| Default value: | True |
| Description: | Show the plot, otherwise return the figure. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| 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. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |
def validate(self) -> None: ...class Ricker2ndDerivative(salvus.flow.simple_config.stf._Base):
def __init__(
self,
center_frequency: float,
time_shift_in_seconds: typing.Optional[float] = None,
): ...| Type: | float |
| Description: | The center frequency of the ricker wavelet. Example: 1.0 |
| 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 |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def apply(self, d: dict | _DeepSetter) -> None: ...| Type: | dict | _DeepSetter |
| Description: | The dictionary to set. |
def copy(self) -> _DeepSetter: ...def get_auto_end_time(self) -> float: ...def get_auto_start_time(self) -> float: ...def get_dictionary(self) -> dict: ...def get_power_spectrum(self) -> tuple[np.ndarray, np.ndarray]: ...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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
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]: ...| Type: | float | None |
| Default value: | None |
| Description: | Sampling rate. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The start time. If not given, it will be computed automatically. |
| Type: | float | None |
| Default value: | None |
| Description: | The end time. If not given, it will be computed automatically. |
def plot(
self, show: bool = True
) -> typing.Optional["matplotlib.figure.Figure"]: ...| Type: | bool |
| Default value: | True |
| Description: | Show the plot, otherwise return the figure. |
def to_json(
self,
external_file_hash: types = None,
timer: types = None,
log_to_logger: bool = False,
comm: types = None,
) -> builtins.dict: ...| 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. |
| Type: | types |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | types |
| Default value: | None |
| Description: | MPI communicator, if any. |
def validate(self) -> None: ...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,
): ...| Type: | float |
| Description: | The center frequency of the tone burst in Hertz. |
| Type: | int |
| Description: | The number of cycles to inject at center_frequency. |
| 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. |
| 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. |
| Type: | float |
| Default value: | 0.0 |
| Description: | Shift the beginning of the burst by this amount. Defaults to 0.0. |
| 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. |