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. |
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(
session: Session,
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 |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
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.
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
update_bandpass
update_bandpass(
session: Session,
event: AimbatEvent,
iccs: ICCS,
context: bool,
all_seismograms: bool,
use_matrix_image: bool,
return_fig: bool,
) -> tuple[Figure, Axes, Any] | None
Update the bandpass filter parameters for an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
event
|
AimbatEvent
|
AimbatEvent. |
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 |
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(
session: Session,
event: AimbatEvent,
iccs: ICCS,
context: bool,
all_seismograms: bool,
return_fig: bool,
) -> tuple[Figure, Axes, Any] | None
Update the minimum cross-correlation threshold for the given event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
event
|
AimbatEvent
|
AimbatEvent. |
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 |
return_fig
|
bool
|
If True, return the figure, axes and widget objects instead of showing the plot. |
required |
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(
session: Session,
iccs: ICCS,
context: bool,
all_seismograms: bool,
use_matrix_image: bool,
return_fig: bool,
) -> tuple[Figure, Axes, Any] | None
Update the phase pick (t1) for an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
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 |
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(
session: Session,
event: AimbatEvent,
iccs: ICCS,
context: bool,
all_seismograms: bool,
use_matrix_image: bool,
return_fig: bool,
) -> tuple[Figure, Axes, Any] | None
Update the cross-correlation time window for the given event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
event
|
AimbatEvent
|
AimbatEvent. |
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 |
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes, Any] | None
|
A tuple of (Figure, Axes, widgets) if return_fig is True, otherwise None. |