Mondaic

salvus.project.components.visualization.notebook_visualization_component

salvus.project.components.visualization.notebook_visualization_component salvus project components visualization notebook_visualization_component

The notebook visualization component.

Functions

get_gradients_widget()

def get_gradients_widget(
    project: Project,
    simulation_configuration: str,
    misfit_configuration: str,
    wavefield_compression: WavefieldCompression,
    events: (
        str
        | typing.Sequence[str]
        | Event
        | typing.Sequence[Event]
        | EventCollection
        | None
    ) = None,
    html: bool = True,
) -> ipywidgets.VBox | None: ...

Launch a notebook visualization of structural gradients.

Plots the event-dependent gradient on the mesh, as well as the sources and receivers

Parameters
  • project Project — Project.
  • simulation_configuration str — Name of the simulation configuration.
  • misfit_configuration str — Misfit configuration.
  • wavefield_compression WavefieldCompression — Wavefield compression settings.
  • events str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection | None — List of events to plot (optional).
  • html bool — Return html or widget.
Returns ipywidgets.VBox | None

get_inversion_widget()

def get_inversion_widget(
    project: Project, inverse_problem_configuration: str, html: bool = True
) -> ipywidgets.VBox | None: ...

Launch a notebook visualization of an iteration.

Plots all models associated with the iteration

Parameters
  • project Project — Project.
  • inverse_problem_configuration str — Name of the inverse problem.
  • html bool — Return html or widget.
Returns ipywidgets.VBox | None

get_iteration_widget()

def get_iteration_widget(
    project: Project,
    inverse_problem_configuration: str,
    iteration_id: int,
    html: bool = True,
) -> ipywidgets.VBox | None: ...

Launch a notebook visualization of an iteration.

Plots all models associated with the iteration

Parameters
  • project Project — Project.
  • inverse_problem_configuration str — Name of the inverse problem.
  • iteration_id int — Iteration id.
  • html bool — Return html or widget.
Returns ipywidgets.VBox | None

get_iterations_widget()

def get_iterations_widget(
    project: Project,
    inverse_problem_configuration: str,
    iteration_ids: typing.Sequence[int] | None = None,
    html: bool = True,
) -> ipywidgets.VBox | None: ...

Launch a notebook visualization of structural gradients.

Plots the event-dependent gradient on the mesh, as well as the sources and receivers

Parameters
  • project Project — Project.
  • inverse_problem_configuration str — Name of the inverse problem configuration.
  • iteration_ids typing.Sequence[int] | None — Optional list of iteration IDs.
  • html bool — Return html or widget.
Returns ipywidgets.VBox | None

Classes

NotebookVisualizationComponent

class NotebookVisualizationComponent(builtins.object):
    def __init__(self, project: Project): ...

Jupyter notebook specific visualizations.

Parameters
  • project Project — The project to attach the component to.
Methods
domain()
def domain(self) -> Domain: ...

Visualize the domain including all events.

Returns Domain
gradients()
def gradients(
    self,
    simulation_configuration: str,
    misfit_configuration: str,
    wavefield_compression: WavefieldCompression | None = None,
    events: (
        str
        | typing.Sequence[str]
        | Event
        | typing.Sequence[Event]
        | EventCollection
        | None
    ) = None,
) -> None: ...

Launch a notebook visualization of structural gradients.

Plots the event-dependent gradient on the mesh, as well as the sources and receivers

Parameters
  • simulation_configuration str — Name of the simulation configuration.
  • misfit_configuration str — Misfit configuration.
  • wavefield_compression WavefieldCompression | None — The wavefield compression settings.
  • events str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection | None — List of events to plot (optional).
Returns None
inversion()
def inversion(self, inverse_problem_configuration: str) -> None: ...

Launch a notebook visualization of an inversion.

Plots and displays info about models, misfits, and more.

Parameters
  • inverse_problem_configuration str — Name of the inverse problem.
Returns None
iteration()
def iteration(
    self, inverse_problem_configuration: str, iteration_id: int
) -> None: ...

Launch a notebook visualization of an iteration.

Plots all models associated with the iteration

Parameters
  • inverse_problem_configuration str — Name of the inverse problem.
  • iteration_id int — Iteration id.
Returns None
misfit_comparison()
def misfit_comparison(
    self,
    reference_data: str,
    other_data: list[str] | None = None,
    misfit_configuration: str,
    event: str | Event,
) -> typing.Any: ...

Show a misfit comparison table comparing the misfit for one set of synthetics to one or more others.

Parameters
  • reference_data str — The synthetics for the baseline misfit.
  • other_data list[str] | None — One or more other misfits to be compared against the baseline. If not given it will just show the misfits for the reference data.
  • misfit_configuration str — The misfit configuration.
  • event str | Event — The event to do it for.
Returns typing.Any
misfits()
def misfits(
    self,
    simulation_configuration: str,
    misfit_configuration: str,
    events: (
        str
        | typing.Sequence[str]
        | Event
        | typing.Sequence[Event]
        | EventCollection
        | None
    ) = None,
) -> None: ...

Visualize misfits in a jupyter notebook.

Parameters
  • simulation_configuration str — The simulation configuration to visualize.
  • misfit_configuration str — The misfit configuration to visualize.
  • events str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection | None — events to include in the widget. If None, all events in the project are included.
Returns None
simulation_setup()
def simulation_setup(
    self,
    simulation_configuration: str,
    events: (
        str
        | typing.Sequence[str]
        | Event
        | typing.Sequence[Event]
        | EventCollection
        | None
    ) = None,
) -> simple_config.simulation.Waveform | UnstructuredMesh: ...

Launch a notebook visualization of a simulation configuration.

Plots the mesh, as well as the sources and receivers

Parameters
  • simulation_configuration str — Name of the simulation configuration.
  • events str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection | None — List of events to plot.
Returns simple_config.simulation.Waveform | UnstructuredMesh
waveforms()
def waveforms(
    self,
    data: list[str] | str,
    receiver_field: str,
    data_selection_configuration: str | None = None,
) -> None: ...

Waveform data comparison in the notebooks.

Parameters
  • data list[str] | str — List of data names to visualize. Allows piping data through processing functionality, e.g. “data_name|normalize”.
  • receiver_field str — The receiver field to use.
  • data_selection_configuration str | None — Name of the data selection configuration to apply/visualize.
Returns None

Used in tutorials