Required
project| Type: | salvus.project.Project |
| Description: | The project to attach the visualization component to. |
class VisualizationComponent(builtins.object):
def __init__(self, project: salvus.project.Project): ...| Type: | salvus.project.Project |
| Description: | The project to attach the visualization component to. |
def custom_gather(
self,
data: str | list[str],
event: str | Event,
receiver_field: str,
component: str,
sort_by: typing.Callable | None = None,
filter_by: typing.Callable[[_Base], bool] | None = None,
select_by: (
typing.Callable[
[list[tuple[_Base, obspy.Stream]], EventData],
list[tuple[_Base, obspy.Stream]],
]
| None
) = None,
interleave: bool = False,
colors: list[typing.Any] | None = None,
alpha: float | None = None,
plot_using: PlotProperties | matplotlib.axes.Axes = PlotProperties(
width=11.5, height=6.33, dpi=100
),
data_selection_configuration: str | None = None,
fast_unsafe: bool = False,
) -> matplotlib.axes.Axes: ...| Type: | str | list[str] |
| Description: | Data name or list of data names to plot. |
| Type: | str | Event |
| Description: | The event to use. |
| Type: | str |
| Description: | The receiver field to plot. |
| Type: | str |
| Description: | The component to plot. |
| Type: | typing.Callable | None |
| Default value: | None |
| Description: | Callback function called with the receiver objects to determine the sorting. Works like the key callback for the standard Python sorted() method. |
| Type: | typing.Callable[[_Base], bool] | None |
| Default value: | None |
| Description: | Callback function called with the receiver objects in internal Salvus format to determine the filtering. Works like the callback for the standard Python filter() method. For complex filter operations requiring all receivers, defer to the select_by method. |
| Type: | typing.Callable[[list[tuple[_Base, obspy.Stream]], EventData], list[tuple[_Base, obspy.Stream]]] | None |
| Default value: | None |
| Description: | Callback function called with a list of tuples in the receiver objects in both internal Salvus and ObsPy Stream format, as well as the EventData objects. |
| Type: | bool |
| Default value: | False |
| Description: | Whether or not to alternatingly plot data. If false, traces from all data will be plotted on top of each other. |
| Type: | list[typing.Any] | None |
| Default value: | None |
| Description: | The colors for the individual traces. Must be exactly as many colors as data items. If not given, it will attempt to choose suitable colors. |
| Type: | float | None |
| Default value: | None |
| Description: | The opacity of all data, as used in Matplotlib. useful when setting interleave to false. |
| Type: | PlotProperties | matplotlib.axes.Axes |
| Default value: | PlotProperties(width=11.5, height=6.33, dpi=100) |
| Description: | The configuration of the axis to create or reuse. Will default to the standard size as defined in the PlotProperties dataclass. |
| Type: | str | None |
| Default value: | None |
| Description: | The data selection configuration to use. |
| Type: | bool |
| Default value: | False |
| Description: | Collect data on the largest instead of smallest time step. Will potentially alias data if largest time step of the data is larger than the highest relevant frequencies across the data, but does speed up plotting in cases where time axes are restrictive, e.g. simulations with relatively many time steps, which would normally lead to massive interpolation expense. |
def interval_window_statistics(
self, data_selection_configuration: str
) -> pandas.io.formats.style.Styler: ...| Type: | str |
| Description: | The data selection configuration whose windows to plot. |
def misfit_histogram(
self,
simulation_configuration_a: str,
simulation_configuration_b: str | None = None,
misfit_configuration: str,
events: str | Event | list[str | Event],
bins: int = 10,
merge_all_components: bool = False,
show: bool = True,
) -> matplotlib.figure.Figure | None: ...| Type: | str |
| Description: | Name of the simulation configuration whose misfits to plot. |
| Type: | str | None |
| Default value: | None |
| Description: | Optionally plot misfits of a second configuration to be able to compare two configurations. |
| Type: | str |
| Description: | The misfit configuration to use for the comparison. |
| Type: | int |
| Default value: | 10 |
| Description: | How many bins to use. |
| Type: | bool |
| Default value: | False |
| Description: | If False, a separate histogram will be computed for each component, otherwise a single histogram will be computed by merging all misfit measurements. |
| Type: | bool |
| Default value: | True |
| Description: | If True the figure will be shown immediately. Otherwise the matplotlib figure object will be returned. |
def shotgather(
self,
data: str | list[str],
event: str | Event,
receiver_field: str,
component: str,
colors: list[typing.Any] | None = None,
sort_by: typing.Callable | None = None,
filter_by: typing.Callable[[_Base], bool] | None = None,
select_by: (
typing.Callable[
[list[tuple[_Base, obspy.Stream]], EventData],
list[tuple[_Base, obspy.Stream]],
]
| None
) = None,
plot_using: PlotProperties | matplotlib.axes.Axes = PlotProperties(
width=11.5, height=6.33, dpi=100
),
data_selection_configuration: str | None = None,
fast_unsafe: bool = False,
) -> matplotlib.axes.Axes: ...| Type: | str | list[str] |
| Description: | Data name or list of data names to plot. |
| Type: | str | Event |
| Description: | The event to use. |
| Type: | str |
| Description: | The receiver field to plot. |
| Type: | str |
| Description: | The component to plot. |
| Type: | list[typing.Any] | None |
| Default value: | None |
| Description: | The colors for the individual traces. Must be exactly as many colors as data items. If not given, it will attempt to choose suitable colors. |
| Type: | typing.Callable | None |
| Default value: | None |
| Description: | Callback function called with the receiver objects to determine the sorting. Works like the key callback for the standard Python sorted() method. |
| Type: | typing.Callable[[_Base], bool] | None |
| Default value: | None |
| Description: | Callback function called with the receiver objects in internal Salvus format to determine the filtering. Works like the callback for the standard Python filter() method. For complex filter operations requiring all receivers, defer to the select_by method. |
| Type: | typing.Callable[[list[tuple[_Base, obspy.Stream]], EventData], list[tuple[_Base, obspy.Stream]]] | None |
| Default value: | None |
| Description: | Callback function called with a list of tuples in the receiver objects in both internal Salvus and ObsPy Stream format, as well as the EventData objects. |
| Type: | PlotProperties | matplotlib.axes.Axes |
| Default value: | PlotProperties(width=11.5, height=6.33, dpi=100) |
| Description: | The configuration of the axis to create or reuse. Will default to the standard size as defined in the PlotProperties dataclass. |
| Type: | str | None |
| Default value: | None |
| Description: | The data selection configuration to use. |
| Type: | bool |
| Default value: | False |
| Description: | Collect data on the largest instead of smallest time step. Will potentially alias data if largest time step of the data is larger than the highest relevant frequencies across the data, but does speed up plotting in cases where time axes are restrictive, e.g. simulations with relatively many time steps, which would normally lead to massive interpolation expense. |
def waveforms(
self,
data: str | list[str],
event: str | Event,
receiver_name: str,
receiver_field: str,
data_selection_configuration: str | None = None,
apply_data_selection_configuration: bool = False,
_cache: dict | None = None,
) -> list[str]: ...| Type: | str | list[str] |
| Description: | One or more waveform names to plot. |
| Type: | str | Event |
| Description: | Event for which to plot waveforms. |
| Type: | str |
| Description: | Receiver name for which to plot waveforms. |
| Type: | str |
| Description: | The receiver field to plot. |
| Type: | str | None |
| Default value: | None |
| Description: | Data selection configuration to apply. |
| Type: | bool |
| Default value: | False |
| Description: | If True, a potentially given data selection configuration will be applied, otherwise interval windows within the data selection configuration will just be plotted in the background. |
| Type: | dict | None |
| Default value: | None |
| Description: | A dictionary that will optionally be used to cache output. The caller is responsible for evicting/clearing the cache. |