Mondaic
This API reference is not for the latest stable Salvus version.

salvus.project.components.visualization.notebook_visualization_component

Functions

get_gradients_widget()

def get_gradients_widget(
    project: salvus.project.project.Project,
    simulation_configuration: str,
    misfit_configuration: str,
    wavefield_compression: salvus.flow.collections.wavefield_compression.WavefieldCompression,
    events: Optional[
        str,
        Sequence[str],
        salvus.flow.collections.event.Event,
        Sequence[salvus.flow.collections.event.Event],
        salvus.flow.collections.event_collection.EventCollection,
    ] = None,
    html: bool = True,
) -> Optional[ipywidgets.VBox]:
    ...

Launch a notebook visualization of structural gradients.

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

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

get_inversion_widget()

def get_inversion_widget(
    project: salvus.project.project.Project,
    inverse_problem_configuration: str,
    html: bool = True,
) -> Optional[ipywidgets.VBox]:
    ...

Launch a notebook visualization of an iteration.

Plots all models associated with the iteration

Parameters
  • project salvus.project.project.Project — Project.
  • inverse_problem_configuration str — Name of the inverse problem.
  • html bool — Return html or widget.
Returns Optional[ipywidgets.VBox]

get_iteration_widget()

def get_iteration_widget(
    project: salvus.project.project.Project,
    inverse_problem_configuration: str,
    iteration_id: int,
    html: bool = True,
) -> Optional[ipywidgets.VBox]:
    ...

Launch a notebook visualization of an iteration.

Plots all models associated with the iteration

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

get_iterations_widget()

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

Launch a notebook visualization of structural gradients.

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

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

Classes

NotebookVisualizationComponent

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

Jupyter notebook specific visualizations.

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

Visualize the domain including all events.

Returns salvus.project.domain.Domain
gradients()
def gradients(
    self,
    simulation_configuration: str,
    misfit_configuration: str,
    wavefield_compression: Optional[
        salvus.flow.collections.wavefield_compression.WavefieldCompression
    ] = None,
    events: Optional[
        str,
        Sequence[str],
        salvus.flow.collections.event.Event,
        Sequence[salvus.flow.collections.event.Event],
        salvus.flow.collections.event_collection.EventCollection,
    ] = 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 Optional[salvus.flow.collections.wavefield_compression.WavefieldCompression] — The wavefield compression settings.
  • events Optional[str, Sequence[str], salvus.flow.collections.event.Event, Sequence[salvus.flow.collections.event.Event], salvus.flow.collections.event_collection.EventCollection] — 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: Optional[List[str]] = None,
    misfit_configuration: str,
    event: Union[str, salvus.flow.collections.event.Event],
) -> 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 Optional[List[str]] — 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 Union[str, salvus.flow.collections.event.Event] — The event to do it for.
Returns Any
misfits()
def misfits(
    self, simulation_configuration: str, misfit_configuration: str
) -> None:
    ...

Visualize misfits in a jupyter notebook.

Parameters
  • simulation_configuration str — The simulation configuration to visualize.
  • misfit_configuration str — The misfit configuration to visualize.
Returns None
simulation_setup()
def simulation_setup(
    self,
    simulation_configuration: str,
    events: Optional[
        str,
        Sequence[str],
        salvus.flow.collections.event.Event,
        Sequence[salvus.flow.collections.event.Event],
        salvus.flow.collections.event_collection.EventCollection,
    ] = None,
) -> Union[
    salvus.flow.simple_config.simulation.waveform.Waveform,
    salvus.mesh.unstructured_mesh.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 Optional[str, Sequence[str], salvus.flow.collections.event.Event, Sequence[salvus.flow.collections.event.Event], salvus.flow.collections.event_collection.EventCollection] — List of events to plot.
Returns Union[salvus.flow.simple_config.simulation.waveform.Waveform, salvus.mesh.unstructured_mesh.UnstructuredMesh]
waveforms()
def waveforms(
    self,
    data: Union[List[str], str],
    receiver_field: str,
    data_selection_configuration: Optional[str] = None,
) -> None:
    ...

Waveform data comparison in the notebooks.

Parameters
  • data Union[List[str], str] — List of data names to visualize.
  • receiver_field str — The receiver field to use.
  • data_selection_configuration Optional[str] — Name of the data selection configuration to apply/visualize.
Returns None