Mondaic

salvus.opt.misfits.graph_space_optimal_transport

salvus.opt.misfits.graph_space_optimal_transport salvus opt misfits graph_space_optimal_transport

Graph-space optimal transport.

Functions

graph_space_optimal_transport_misfit_and_adjoint_source()

def graph_space_optimal_transport_misfit_and_adjoint_source(
    data_synthetic: np.ndarray,
    data_observed: np.ndarray,
    sampling_rate_in_hertz: float,
    p: float,
    max_expected_time_shift: salvus._core.types.float_,
    plot: bool = False,
    return_assignment: bool = False,
) -> (
    tuple[float, np.ndarray] | tuple[float, np.ndarray, np.ndarray, np.ndarray]
): ...

Compute a graph-space optimal transport based misfit and adjoint source.

It largely implements it as described here https://doi.org/10.1088/1361-6420/ab206f but uses a different algorithm to solve the assignment problem.

Parameters
  • data_synthetic np.ndarray — synthetic waveforms.
  • data_observed np.ndarray — observed waveforms.
  • sampling_rate_in_hertz float — Sampling rate.
  • p float — Minkowski p-norm to use for the distance computation in the graph/point-cloud space.
  • max_expected_time_shift salvus._core.types.float_ — The maximum expected time shift in seconds.
  • plot bool — Plot the transport paths and the adjoint source. Very useful for debugging and tuning.
  • return_assignment bool — Optionally return the distance matrix and the optimal assignment, which is useful for visualizing the optimal transport map.
Returns tuple[float, np.ndarray] | tuple[float, np.ndarray, np.ndarray, np.ndarray] — tuple of misfit value and adjoint source by default, or a tuple of mifit value, adjoint source, distance matrix and the assignment when return_assignment is True.