Required
name| Type: | str |
| Description: | The name of the data normalization. |
def get_available_data_normalizations() -> list[str]: ...list[str]def get_data_normalization(name: str) -> Normalization: ...| Type: | str |
| Description: | The name of the data normalization. |
Normalizationclass Proto(Protocol): def meth(self) -> int: ...
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
class GenProto(Protocol[T]): def meth(self) -> T: ...
class ForwardNormProtocol(typing.Protocol):
def __init__(self):
...class Proto(Protocol): def meth(self) -> int: ...
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
class GenProto(Protocol[T]): def meth(self) -> T: ...
class ForwardTraceNormProtocol(typing.Protocol):
def __init__(self):
...class Proto(Protocol): def meth(self) -> int: ...
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
class GenProto(Protocol[T]): def meth(self) -> T: ...
class JacobianNormProtocol(typing.Protocol):
def __init__(self):
...class Proto(Protocol): def meth(self) -> int: ...
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
class GenProto(Protocol[T]): def meth(self) -> T: ...
class JacobianTraceNormProtocol(typing.Protocol):
def __init__(self):
...class Normalization(
salvus.flow.utils.serialization_helpers.SerializationMixin, typing.Generic
):
def __init__(
self,
forward: ForwardNormProtocol | str,
jacobian: JacobianNormProtocol | str,
skip_validation: bool = False,
): ...| Type: | ForwardNormProtocol | str |
| Description: | Function implementing the data normalization. |
| Type: | JacobianNormProtocol | str |
| Description: | Function implementing the jacobian of the data normalization. |
| Type: | bool |
| Default value: | False |
| Description: | By default the forward and jacobian functions will be validated with a gradient test. Set this to True to skip that test. |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def forward(
self,
data_array_synthetic: xr.DataArray,
data_array_observed: T,
event: Event,
) -> tuple[xr.DataArray, T]: ...| Type: | xr.DataArray |
| Description: | The synthetic data traces without normalization. |
| Type: | T |
| Description: | The observed data traces without normalization. |
| Type: | Event |
| Description: | The event object. |
def jacobian(
self,
data_array_adjoint_sources: xr.DataArray,
data_array_synthetic: xr.DataArray,
data_array_observed: T,
event: Event,
) -> xr.DataArray: ...| Type: | xr.DataArray |
| Description: | The adjoint sources. |
| Type: | xr.DataArray |
| Description: | The synthetic data traces without normalization. |
| Type: | T |
| Description: | The observed data traces without normalization. |
| Type: | Event |
| Description: | The event object. |
def perform_gradient_test(self) -> None: ...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. |
class TraceNormalization(
salvus.flow.utils.serialization_helpers.SerializationMixin, typing.Generic
):
def __init__(
self,
forward: ForwardTraceNormProtocol | str,
jacobian: JacobianTraceNormProtocol | str,
skip_validation: bool = False,
): ...| Type: | ForwardTraceNormProtocol | str |
| Description: | Function implementing the data normalization. |
| Type: | JacobianTraceNormProtocol | str |
| Description: | Function implementing the jacobian of the data normalization. |
| Type: | bool |
| Default value: | False |
| Description: | By default the forward and jacobian functions will be validated with a gradient test. Set this to True to skip that test. |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def forward(
self,
data_synthetic: npt.NDArray,
data_observed: T,
sampling_rate_in_hertz: float,
) -> tuple[npt.NDArray, T]: ...| Type: | npt.NDArray |
| Description: | The synthetic data trace without normalization. |
| Type: | T |
| Description: | The observed data trace without normalization. |
| Type: | float |
| Description: | The sampling rate of both data traces in Hz. |
def jacobian(
self,
adjoint_source: npt.NDArray,
data_synthetic: npt.NDArray,
data_observed: T,
sampling_rate_in_hertz: float,
) -> npt.NDArray: ...| Type: | npt.NDArray |
| Description: | The adjoint source. |
| Type: | npt.NDArray |
| Description: | The synthetic data trace without normalization. |
| Type: | T |
| Description: | The observed data trace without normalization. |
| Type: | float |
| Description: | The sampling rate of the adjoint source and data in Hz. |
def perform_gradient_test(self) -> None: ...def to_block_normalization(self) -> Normalization: ...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. |