Version:

salvus.project.configuration.misfit_configuration

salvus.project.configuration.misfit_configuration salvus project configuration misfit_configuration
The misfit configuration.

Classes

MisfitConfiguration

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.
Misfit configuration object.
SIGNATURE
class MisfitConfiguration(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        name: str,
        observed_data: str | None,
        misfit_function: str | dict[str, str | int] | typing.Callable,
        extra_kwargs_misfit_function: dict | None = None,
        receiver_field: str,
        data_selection_configuration: str | None = None,
        max_samples_for_misfit_computation: (
            salvus._core.types.int_ | None
        ) = None,
        normalization: (
            data_normalizations.Normalization
            | data_normalizations.TraceNormalization
            | str
            | None
        ) = None,
        extra_output_callback_function: str | typing.Callable | None = None,
    ) -> None: ...
ARGUMENTS
Required
name
Type:str
Description:
The name of the misfit configuration. Must be unique per project.
Required
observed_data
Type:str | None
Description:
The observed data name. Can be None if the misfit function does not require observed_data.
Required
misfit_function
Type:str | dict[str, str | int] | typing.Callable
Description:
The misfit function or name of the function. Can be one of three things: 1. The of one of Salvus' built-in misfit functions. In that case the latest available version will be chosen. 2. A dictionary of the form {"misfit_name": "L2", "version": 1} to directly select a specific version of a built-in misfit function. 3. A custom function that computes misfits and adjoint sources.
Optional
extra_kwargs_misfit_function
Type:dict | None
Default value:None
Description:
Any potentially extra misfit arguments.
Required
receiver_field
Type:str
Description:
The receiver field to use.
Optional
data_selection_configuration
Type:str | None
Default value:None
Description:
Optional data selection configuration to be applied to all data sets during the misfit and adjoint source calculation.
Optional
max_samples_for_misfit_computation
Type:salvus._core.types.int_ | None
Default value:None
Description:
If given, and if the number of samples in the data for the misfit and adjoint source computation is larger than the given number, synthetic and observed data will be downsampled to the chosen number of samples and the adjoint source will later be upsampled again. Very useful for some expensive to compute misfits with strongly oversampled signals. The adjoint source will be correctly scaled at the end. This does result in the adjoint source no longer being the exact discrete derivative of the misfit but in most cases this should not be a problem.
Optional
normalization
Type:data_normalizations.Normalization | data_normalizations.TraceNormalization | str | None
Default value:None
Description:
If given, normalize the observed and synthetic traces prior to misfit and adjoint source computations. This will be accounted for during the computation of the derivatives to ensure consistency. Useful for some problems but it does make them a bit more non-linear. Can be a string that will be mapped to a built-in normalization (See salvus.opt.data_normalizations. get_available_data_normalizations() for all available options) or a custom TraceNormalization object.
Optional
extra_output_callback_function
Type:str | typing.Callable | None
Default value:None
Description:
If given, this function will be used to generate an ExtraOutput object that will be passed to the misfit computation function, mainly to allow for the computation of additional quality control metrics.

Class Methods

MisfitConfiguration.from_json()
Construct object from a JSON-serializable dictionary.
SIGNATURE
def from_json(d: dict) -> MisfitConfiguration: ...
ARGUMENTS
Required
d
Type:dict
Description:
JSON dictionary of the inverse problem.

Methods

MisfitConfiguration.to_json()
Convert object to a JSON-serializable dictionary.
SIGNATURE
def to_json(
    self,
    external_file_hash: str | None = None,
    timer: Timer | None = None,
    log_to_logger: bool = False,
    comm: int | None = None,
) -> dict: ...
ARGUMENTS
Optional
external_file_hash
Type:str | None
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:Timer | None
Default value:None
Description:
Timer | None = None,
Optional
log_to_logger
Type:bool
Default value:False
Description:
bool = False,
Optional
comm
Type:int | None
Default value:None
Description:
int | None = None,
PAGE CONTENTS