aimbat.plot
Visualisation and interactive quality control for seismograms and alignment results.
This module provides tools for generating static plots of seismic data and alignment stacks, as well as interactive interfaces for refining phase picks and time windows. It integrates with matplotlib to support both automated reporting and manual verification workflows.
Functions:
| Name | Description |
|---|---|
plot_matrix_image |
Plot the ICCS seismograms as a matrix image. |
plot_seismograms |
Plot all seismograms for a particular event or station. |
plot_stack |
Plot the ICCS stack. |
show_figure |
Show a figure and block until the user closes its window. |
update_bandpass |
Update the bandpass filter parameters for an event. |
update_min_cc |
Update the minimum cross-correlation threshold for the given event. |
update_pick |
Update the phase pick (t1) for an event. |
update_timewindow |
Update the cross-correlation time window for the given event. |
plot_matrix_image
plot_matrix_image(
iccs: ICCS,
context: bool,
all_seismograms: bool,
return_fig: bool,
) -> tuple[Figure, Axes] | None
Plot the ICCS seismograms as a matrix image.
The matrix is assembled from individual waveforms, with each row representing a different seismogram.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iccs
|
ICCS
|
ICCS instance. |
required |
context
|
bool
|
If True, plot waveforms with extra context around the taper window. |
required |
all_seismograms
|
bool
|
If True, include deselected seismograms in the plot. |
required |
return_fig
|
bool
|
If True, return the figure and axes objects instead of showing the plot. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes] | None
|
A tuple of (Figure, Axes) if return_fig is True, otherwise None. |
Source code in src/aimbat/plot/_iccs.py
plot_seismograms
plot_seismograms(
plot_for: AimbatEvent | AimbatStation, return_fig: bool
) -> tuple[Figure, Axes] | None
Plot all seismograms for a particular event or station.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot_for
|
AimbatEvent | AimbatStation
|
What to plot the seismograms for (Event or Station). |
required |
return_fig
|
bool
|
Whether to return the figure and axes objects instead of showing the plot. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes] | None
|
figure and axes objects if return_fig is True, otherwise None. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no seismograms are found for the event or station. |
Note
The seismograms use the filter settings specified in the event parameters.
plot_for is read while the figure is built, so it must still be attached
to a session at that point; nothing touches it afterwards. Pass
return_fig=True and call show_figure separately to close the session
before the window opens.
Source code in src/aimbat/plot/_seismograms.py
plot_stack
plot_stack(
iccs: ICCS,
context: bool,
all_seismograms: bool,
return_fig: bool,
) -> tuple[Figure, Axes] | None
Plot the ICCS stack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iccs
|
ICCS
|
ICCS instance. |
required |
context
|
bool
|
If True, plot waveforms with extra context around the taper window. |
required |
all_seismograms
|
bool
|
If True, include deselected seismograms in the plot. |
required |
return_fig
|
bool
|
If True, return the figure and axes objects instead of showing the plot. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes] | None
|
A tuple of (Figure, Axes) if return_fig is True, otherwise None. |
Source code in src/aimbat/plot/_iccs.py
show_figure
Show a figure and block until the user closes its window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fig
|
Figure
|
Figure to show. |
required |
update_bandpass
update_bandpass(
event_id: UUID,
iccs: ICCS,
context: bool,
all_seismograms: bool,
use_matrix_image: bool,
return_fig: bool,
engine: Engine | None = None,
) -> tuple[Figure, Axes, Any] | None
Update the bandpass filter parameters for an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
UUID
|
UUID of the event being updated. |
required |
iccs
|
ICCS
|
ICCS instance. |
required |
context
|
bool
|
If True, plot waveforms with extra context around the taper window. |
required |
all_seismograms
|
bool
|
If True, include deselected seismograms in the plot. |
required |
use_matrix_image
|
bool
|
If True, pick from the matrix image; otherwise pick from the stack plot. |
required |
return_fig
|
bool
|
If True, return the figure, axes and widget objects instead of showing the plot. |
required |
engine
|
Engine | None
|
Engine to persist the change with. Defaults to the project engine. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes, Any] | None
|
A tuple of (Figure, Axes, widgets) if return_fig is True, otherwise None. |
Source code in src/aimbat/plot/_iccs.py
update_min_cc
update_min_cc(
event_id: UUID,
iccs: ICCS,
context: bool,
all_seismograms: bool,
causal: bool,
return_fig: bool,
engine: Engine | None = None,
) -> tuple[Figure, Axes, Any] | None
Update the minimum cross-correlation threshold for the given event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
UUID
|
UUID of the event being updated. |
required |
iccs
|
ICCS
|
ICCS instance. |
required |
context
|
bool
|
If True, plot waveforms with extra context around the taper window. |
required |
all_seismograms
|
bool
|
If True, include deselected seismograms in the plot. |
required |
causal
|
bool
|
If True, use causal (single-pass) instead of zero-phase filtering. |
required |
return_fig
|
bool
|
If True, return the figure, axes and widget objects instead of showing the plot. |
required |
engine
|
Engine | None
|
Engine to persist the change with. Defaults to the project engine. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes, Any] | None
|
A tuple of (Figure, Axes, widgets) if return_fig is True, otherwise None. |
Source code in src/aimbat/plot/_iccs.py
update_pick
update_pick(
event_id: UUID,
iccs: ICCS,
context: bool,
all_seismograms: bool,
use_matrix_image: bool,
causal: bool,
return_fig: bool,
engine: Engine | None = None,
) -> tuple[Figure, Axes, Any] | None
Update the phase pick (t1) for an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
UUID
|
UUID of the event being updated. |
required |
iccs
|
ICCS
|
ICCS instance. |
required |
context
|
bool
|
If True, plot waveforms with extra context around the taper window. |
required |
all_seismograms
|
bool
|
If True, include deselected seismograms in the plot. |
required |
use_matrix_image
|
bool
|
If True, pick from the matrix image; otherwise pick from the stack plot. |
required |
causal
|
bool
|
If True, use causal (single-pass) instead of zero-phase filtering. |
required |
return_fig
|
bool
|
If True, return the figure, axes and widget objects instead of showing the plot. |
required |
engine
|
Engine | None
|
Engine to persist the change with. Defaults to the project engine. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes, Any] | None
|
A tuple of (Figure, Axes, widgets) if return_fig is True, otherwise None. |
Source code in src/aimbat/plot/_iccs.py
update_timewindow
update_timewindow(
event_id: UUID,
iccs: ICCS,
context: bool,
all_seismograms: bool,
use_matrix_image: bool,
causal: bool,
return_fig: bool,
engine: Engine | None = None,
) -> tuple[Figure, Axes, Any] | None
Update the cross-correlation time window for the given event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
UUID
|
UUID of the event being updated. |
required |
iccs
|
ICCS
|
ICCS instance. |
required |
context
|
bool
|
If True, plot waveforms with extra context around the taper window. |
required |
all_seismograms
|
bool
|
If True, include deselected seismograms in the plot. |
required |
use_matrix_image
|
bool
|
If True, pick from the matrix image; otherwise pick from the stack plot. |
required |
causal
|
bool
|
If True, use causal (single-pass) instead of zero-phase filtering. |
required |
return_fig
|
bool
|
If True, return the figure, axes and widget objects instead of showing the plot. |
required |
engine
|
Engine | None
|
Engine to persist the change with. Defaults to the project engine. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes, Any] | None
|
A tuple of (Figure, Axes, widgets) if return_fig is True, otherwise None. |