Mondaic

salvus.opt.misfits.gradient_test

salvus.opt.misfits.gradient_test salvus opt misfits gradient_test

Functionality to perform a gradient test of adjoint sources.

Functions

gradient_test_adjoint_sources()

def gradient_test_adjoint_sources(
    f: typing.Callable,
    extra_kwargs: dict,
    plot: bool = False,
    seed: int | None = None,
) -> None: ...

Perform a gradient test with a given adjoint source function.

Parameters
  • f typing.Callable — Function computing an adjoint source.
  • extra_kwargs dict — Extra arguments passed to the adjoint source computation function.
  • plot bool — Plot the gradient test.
  • seed int | None — Optionally pass a seed for the random number generation.
Returns None

gradient_test_block_adjoint_sources()

def gradient_test_block_adjoint_sources(
    f: typing.Callable,
    extra_kwargs: dict | None = None,
    plot: bool = False,
    seed: int | None = None,
) -> None: ...

Perform a gradient test with a given block adjoint source function.

This is the same as the gradient_test_adjoint_sources function but for a block of a few traces instead of just one.

Parameters
  • f typing.Callable — Function computing an adjoint source.
  • extra_kwargs dict | None — Extra arguments passed to the adjoint source computation function.
  • plot bool — Plot the gradient test.
  • seed int | None — Optionally pass a seed for the random number generation.
Returns None