salvus.opt.misfits.graph_space_optimal_transport
Functions
graph_space_optimal_transport_misfit_and_adoint_source()
graph_space_optimal_transport_misfit_and_adoint_source()def graph_space_optimal_transport_misfit_and_adoint_source(
data_synthetic: numpy.ndarray,
data_observed: numpy.ndarray,
sampling_rate_in_hertz: float,
p: Union[float, int],
max_expected_time_shift: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
plot: bool = False,
return_assignment: bool = False,
) -> Union[
Tuple[float, numpy.ndarray],
Tuple[float, numpy.ndarray, numpy.ndarray, numpy.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_syntheticnumpy.ndarray — synthetic waveforms.data_observednumpy.ndarray — observed waveforms.sampling_rate_in_hertzfloat — Sampling rate.pUnion[float, int] — Minkowski p-norm to use for the distance computation in the graph/point-cloud space.max_expected_time_shiftUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — The maximum expected time shift in seconds.plotbool — Plot the transport paths and the adjoint source. Very useful for debugging and tuning.return_assignmentbool — Optionally return the distance matrix and the optimal assignment, which is useful for visualizing the optimal transport map.
Returns Union[Tuple[float, numpy.ndarray], Tuple[float, numpy.ndarray, numpy.ndarray, numpy.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.