aimbat._cli
Modules:
| Name | Description |
|---|---|
align |
Align seismograms using ICCS or MCCC. |
common |
|
data |
Manage data sources in an AIMBAT project. |
event |
View and manage events in the AIMBAT project. |
pick |
Interactively pick phase arrival times and processing parameters. |
plot |
Create plots for seismograms and ICCS results. |
project |
Manage AIMBAT projects. |
seismogram |
View and manage seismograms in the AIMBAT project. |
shell |
Interactive AIMBAT shell with tab-completion and command history. |
snapshot |
View and manage snapshots of processing parameters. |
station |
View and manage stations. |
utils |
Utilities for AIMBAT. |
align
Align seismograms using ICCS or MCCC.
This command aligns seismograms using either the ICCS or MCCC algorithm. Both
commands update the pick stored in t1. If t1 is None, t0 is used as
starting point instead, with the resulting pick stored in t1.
Functions:
| Name | Description |
|---|---|
cli_iccs_run |
Run the ICCS algorithm to align seismograms for an event. |
cli_mccc_run |
Run the MCCC algorithm to refine arrival time picks for an event. |
cli_iccs_run
cli_iccs_run(
event_id: Annotated[UUID, event_parameter()],
*,
autoselect: Annotated[
bool,
Parameter(
name=autoselect,
help="Whether to automatically de-select seismograms whose cross-correlation with the stack falls below `min_cc`, and re-select them if the cross-correlation later exceeds `min_cc`.",
),
] = False,
autoflip: Annotated[
bool,
Parameter(
name=autoflip,
help="Whether to automatically flip seismograms (multiply data by -1) when the cross-correlation is negative.",
),
] = False,
_: DebugParameter = DebugParameter(),
) -> None
Run the ICCS algorithm to align seismograms for an event.
Iteratively cross-correlates seismograms against a running stack to refine
arrival time picks (t1). If t1 is not yet set, t0 is used as the
starting point.
Source code in src/aimbat/_cli/align.py
cli_mccc_run
cli_mccc_run(
event_id: Annotated[UUID, event_parameter()],
*,
all_seismograms: Annotated[
bool,
Parameter(
name=all,
help="Include all seismograms of an event in MCCC processing, not just the currently selected ones.",
),
] = False,
_: DebugParameter = DebugParameter(),
) -> None
Run the MCCC algorithm to refine arrival time picks for an event.
Multi-channel cross-correlation simultaneously determines the optimal time
shifts for all seismograms. Results are stored in t1.
Source code in src/aimbat/_cli/align.py
common
Classes:
| Name | Description |
|---|---|
DebugParameter |
Shared parameter that adds |
EventDebugParameters |
Parameters for commands that operate on individual events, with optional debug mode. |
IccsPlotParameters |
Shared parameters for ICCS plot commands ( |
JsonDumpParameters |
Shared parameters for JSON dump commands ( |
TableParameters |
Shared parameters for table display commands ( |
Functions:
| Name | Description |
|---|---|
event_parameter |
Return a cyclopts |
event_parameter_is_all |
Return |
event_parameter_with_all |
Return a cyclopts |
id_parameter |
Return a cyclopts |
json_to_table |
Print a JSON dict or list of dicts as a rich table driven by a Pydantic model. |
open_in_editor |
Write |
print_error_panel |
Print an exception to the console in a red panel. |
simple_exception |
Decorator to handle exceptions and print them to the console. |
station_parameter_is_all |
Return |
station_parameter_with_all |
Return a cyclopts |
use_event_parameter |
Return a cyclopts |
use_matrix_image |
Return a cyclopts |
use_station_parameter |
Return a cyclopts |
DebugParameter
dataclass
Bases: _DebugTrait
Shared parameter that adds --debug to any CLI command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable verbose logging for troubleshooting. |
False
|
Attributes:
| Name | Type | Description |
|---|---|---|
debug |
bool
|
Enable verbose logging for troubleshooting. |
Source code in src/aimbat/_cli/common/_parameters.py
debug
class-attribute
instance-attribute
debug: bool = False
Enable verbose logging for troubleshooting.
EventDebugParameters
dataclass
Bases: _DebugTrait, _EventContextTrait
Parameters for commands that operate on individual events, with optional debug mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
UUID
|
|
required |
debug
|
bool
|
Enable verbose logging for troubleshooting. |
False
|
Attributes:
| Name | Type | Description |
|---|---|---|
debug |
bool
|
Enable verbose logging for troubleshooting. |
Source code in src/aimbat/_cli/common/_parameters.py
debug
class-attribute
instance-attribute
debug: bool = False
Enable verbose logging for troubleshooting.
IccsPlotParameters
dataclass
Shared parameters for ICCS plot commands (--context, --all).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
bool
|
|
True
|
all_seismograms
|
bool
|
|
False
|
Source code in src/aimbat/_cli/common/_parameters.py
JsonDumpParameters
dataclass
Bases: _ByAliasTrait, _DebugTrait
Shared parameters for JSON dump commands (--alias, --debug).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable verbose logging for troubleshooting. |
False
|
by_alias
|
bool
|
|
False
|
Attributes:
| Name | Type | Description |
|---|---|---|
debug |
bool
|
Enable verbose logging for troubleshooting. |
Source code in src/aimbat/_cli/common/_parameters.py
debug
class-attribute
instance-attribute
debug: bool = False
Enable verbose logging for troubleshooting.
TableParameters
dataclass
Bases: _TableParametersTrait, _DebugTrait
Shared parameters for table display commands (--raw, --debug).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable verbose logging for troubleshooting. |
False
|
raw
|
bool
|
|
False
|
Attributes:
| Name | Type | Description |
|---|---|---|
debug |
bool
|
Enable verbose logging for troubleshooting. |
Source code in src/aimbat/_cli/common/_parameters.py
debug
class-attribute
instance-attribute
debug: bool = False
Enable verbose logging for troubleshooting.
event_parameter
event_parameter(help: str | None = None) -> Parameter
Return a cyclopts Parameter for selecting a single event by UUID or prefix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
help
|
str | None
|
Custom help string; falls back to a generic event UUID prompt. |
None
|
Source code in src/aimbat/_cli/common/_parameters.py
event_parameter_is_all
Return True if event_id is the literal string "all" (case-insensitive).
Source code in src/aimbat/_cli/common/_parameters.py
event_parameter_with_all
event_parameter_with_all(
help: str | None = None,
) -> Parameter
Return a cyclopts Parameter for selecting an event or the literal "all".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
help
|
str | None
|
Custom help string; falls back to a generic prompt. |
None
|
Source code in src/aimbat/_cli/common/_parameters.py
id_parameter
Return a cyclopts Parameter for selecting a record by UUID or unique prefix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_class
|
type
|
AIMBAT model class used to resolve short UUID prefixes. |
required |
help
|
str
|
Custom help string; falls back to a generic UUID prompt if empty. |
''
|
Source code in src/aimbat/_cli/common/_parameters.py
json_to_table
json_to_table(
data: dict[str, Any] | list[dict[str, Any]],
model: type[BaseModel],
title: str | None = None,
raw: bool = False,
col_specs: dict[str, RichColSpec] | None = None,
column_order: list[str] | None = None,
key_header: str = "Property",
value_header: str = "Value",
) -> None
Print a JSON dict or list of dicts as a rich table driven by a Pydantic model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any] | list[dict[str, Any]]
|
A single row (dict) or list of rows to display. |
required |
model
|
type[BaseModel]
|
Pydantic model whose field metadata drives column configuration. |
required |
title
|
str | None
|
Optional table title. |
None
|
raw
|
bool
|
If |
False
|
col_specs
|
dict[str, RichColSpec] | None
|
Optional per-field overrides. Each entry is merged on top of
the spec derived from the model field, so only the attributes that
differ need to be set. Ignored when |
None
|
column_order
|
list[str] | None
|
Optional list of field names that should appear first, in that order. Fields not listed appear after in model-declaration order. |
None
|
key_header
|
str
|
Header for the property-name column in vertical (dict) tables. |
'Property'
|
value_header
|
str
|
Header for the value column in vertical (dict) tables. |
'Value'
|
Source code in src/aimbat/_cli/common/_table.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
open_in_editor
Write initial_content to a temporary Markdown file, open it in $EDITOR,
and return the (possibly updated) content after the editor exits.
The temporary file uses delete=False so that it can be opened by a
second process on Windows (which prohibits opening a file that is already
open). It is always removed in a finally block.
The editor command is taken from $EDITOR or $VISUAL. If neither is
set, notepad is used on Windows and vi elsewhere. To use a GUI editor
that does not block by default (e.g. VS Code), set
EDITOR="code --wait".
Source code in src/aimbat/_cli/common/_parameters.py
print_error_panel
print_error_panel(e: Exception) -> None
Print an exception to the console in a red panel.
Source code in src/aimbat/_cli/common/_decorators.py
simple_exception
Decorator to handle exceptions and print them to the console.
Using this decorator prints only the exception to the console without traceback, and then exits. In debugging mode this decorator returns the callable unchanged.
Source code in src/aimbat/_cli/common/_decorators.py
station_parameter_is_all
Return True if station_id is the literal string "all" (case-insensitive).
Source code in src/aimbat/_cli/common/_parameters.py
station_parameter_with_all
station_parameter_with_all(
help: str | None = None,
) -> Parameter
Return a cyclopts Parameter for selecting a station or the literal "all".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
help
|
str | None
|
Custom help string; falls back to a generic prompt. |
None
|
Source code in src/aimbat/_cli/common/_parameters.py
use_event_parameter
Return a cyclopts Parameter for linking data to an existing event record.
Source code in src/aimbat/_cli/common/_parameters.py
use_matrix_image
Return a cyclopts Parameter for switching from stack to matrix image plots.
use_station_parameter
Return a cyclopts Parameter for linking data to an existing station record.
Source code in src/aimbat/_cli/common/_parameters.py
data
Manage data sources in an AIMBAT project.
A data source is a file that AIMBAT reads seismogram waveforms and metadata from. When a data source is added, AIMBAT extracts and stores the associated station, event, and seismogram records in the project database — provided the data type supports it.
Supported data types (--type):
sac(default): SAC waveform file. Extracts station, event, and seismogram data automatically.json_station: JSON file containing station metadata only. No seismogram is created.json_event: JSON file containing event metadata only. No seismogram is created.
Typical workflow:
aimbat project create
aimbat data add *.sac
aimbat event list # list events created from SAC headers
aimbat snapshot create "initial import" --event-id <ID>
Re-adding a data source that is already in the project is safe — existing records are reused rather than duplicated.
Functions:
| Name | Description |
|---|---|
cli_data_add |
Add or update data sources in the AIMBAT project. |
cli_data_dump |
Dump AIMBAT datasources table as a JSON string. |
cli_data_list |
Print a table of data sources registered in the AIMBAT project. |
cli_data_add
cli_data_add(
data_sources: Annotated[
list[Path],
Parameter(
name="sources",
help="One or more data source paths to add.",
consume_multiple=1,
negative_iterable=(),
validator=Path(exists=True),
),
],
*,
data_type: Annotated[
DataType,
Parameter(
name="type",
help="Format of the data sources. Determines which metadata (station, event, seismogram) can be extracted automatically.",
),
] = SAC,
station_id: Annotated[
UUID | None, use_station_parameter()
] = None,
event_id: Annotated[
UUID | None, use_event_parameter()
] = None,
dry_run: Annotated[
bool,
Parameter(
name="dry-run",
help="Preview which records would be added without modifying the database.",
),
] = False,
show_progress_bar: Annotated[
bool,
Parameter(
name="progress",
help="Display a progress bar while ingesting sources.",
),
] = True,
_: DebugParameter = DebugParameter(),
) -> None
Add or update data sources in the AIMBAT project.
Each data source is processed according to --type. For sac (the
default), AIMBAT extracts station, event, and seismogram metadata directly
from the file. For types that cannot extract a station or event (e.g. a
format that only carries waveform data), supply --use-station and/or
--use-event to link to records that already exist in the project.
Station and event deduplication is automatic: if a matching record already
exists it is reused. Re-running data add on the same files is safe.
Use --dry-run to preview what would be added without touching the
database.
Source code in src/aimbat/_cli/data.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
cli_data_dump
cli_data_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump AIMBAT datasources table as a JSON string.
Output can be piped or redirected for use in external tools or scripts.
Source code in src/aimbat/_cli/data.py
cli_data_list
cli_data_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
Print a table of data sources registered in the AIMBAT project.
Source code in src/aimbat/_cli/data.py
event
View and manage events in the AIMBAT project.
Functions:
| Name | Description |
|---|---|
cli_event_delete |
Delete existing event. |
cli_event_dump |
Dump the contents of the AIMBAT event table to JSON. |
cli_event_list |
Print a table of events stored in the AIMBAT project. |
cli_event_note_edit |
Open the event note in |
cli_event_note_read |
Display the note attached to an event, rendered as Markdown. |
cli_event_parameter_dump |
Dump event parameter table to json. |
cli_event_parameter_get |
Get parameter value for an event. |
cli_event_parameter_list |
List processing parameter for an event or all events. |
cli_event_parameter_set |
Set parameter value for an event. |
cli_event_quality_dump |
Dump event quality statistics to JSON. |
cli_event_quality_list |
Show aggregated quality statistics for an event or all events. |
cli_event_delete
cli_event_delete(
event_id: Annotated[UUID, event_parameter()],
*,
_: DebugParameter = DebugParameter(),
) -> None
Delete existing event.
Source code in src/aimbat/_cli/event.py
cli_event_dump
cli_event_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump the contents of the AIMBAT event table to JSON.
Output can be piped or redirected for use in external tools or scripts.
Source code in src/aimbat/_cli/event.py
cli_event_list
cli_event_list(
*, table_parameters: TableParameters = TableParameters()
) -> None
Print a table of events stored in the AIMBAT project.
Source code in src/aimbat/_cli/event.py
cli_event_note_edit
cli_event_note_edit(
event_id: Annotated[UUID, event_parameter()],
*,
_: DebugParameter = DebugParameter(),
) -> None
Open the event note in $EDITOR and save changes on exit.
The note is written to a temporary Markdown file. When the editor closes, the updated content is saved back to the database. If the file is left unchanged, no write is performed.
On Windows, set the EDITOR environment variable to your preferred editor
(e.g. notepad, notepad++). The editor must be a blocking process; for
GUI editors that do not block by default (such as VS Code), pass the
appropriate wait flag (e.g. EDITOR="code --wait").
Source code in src/aimbat/_cli/event.py
cli_event_note_read
cli_event_note_read(
event_id: Annotated[UUID, event_parameter()],
*,
_: DebugParameter = DebugParameter(),
) -> None
Display the note attached to an event, rendered as Markdown.
Source code in src/aimbat/_cli/event.py
cli_event_parameter_dump
cli_event_parameter_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump event parameter table to json.
Source code in src/aimbat/_cli/event.py
cli_event_parameter_get
cli_event_parameter_get(
name: EventParameter,
*,
event_debug_parameters: EventDebugParameters,
) -> None
Get parameter value for an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
EventParameter
|
Event parameter name. |
required |
Source code in src/aimbat/_cli/event.py
cli_event_parameter_list
cli_event_parameter_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
List processing parameter for an event or all events.
Displays all event-level parameters (e.g. time window, bandpass filter settings, minimum cc) in a table.
Source code in src/aimbat/_cli/event.py
cli_event_parameter_set
cli_event_parameter_set(
name: EventParameter,
value: str,
*,
event_debug_parameters: EventDebugParameters,
) -> None
Set parameter value for an event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
EventParameter
|
Event parameter name. |
required |
value
|
str
|
New parameter value. |
required |
Source code in src/aimbat/_cli/event.py
cli_event_quality_dump
cli_event_quality_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump event quality statistics to JSON.
Output can be piped or redirected for use in external tools or scripts.
Source code in src/aimbat/_cli/event.py
cli_event_quality_list
cli_event_quality_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
Show aggregated quality statistics for an event or all events.
Displays ICCS and MCCC quality metrics (means, SEMs, RMSE) aggregated across the seismograms of each event.
Source code in src/aimbat/_cli/event.py
pick
Interactively pick phase arrival times and processing parameters.
These commands open an interactive matplotlib plot for an event. Use
--event-id or set the DEFAULT_EVENT_ID environment variable to choose
which event to pick. Click on the plot to set the chosen value, then close
the window to save it.
Functions:
| Name | Description |
|---|---|
cli_pick_min_cc |
Interactively pick a new minimum cross-correlation for auto-selection. |
cli_pick_timewindow |
Interactively pick a new cross-correlation time window for an event. |
cli_update_phase_pick |
Interactively pick a new phase arrival time (t1) for an event. |
cli_pick_min_cc
cli_pick_min_cc(
event_id: Annotated[UUID, event_parameter()],
*,
iccs_plot_parameters: IccsPlotParameters = IccsPlotParameters(),
use_matrix_image: Annotated[
bool, use_matrix_image()
] = True,
_: DebugParameter = DebugParameter(),
) -> None
Interactively pick a new minimum cross-correlation for auto-selection.
Opens an interactive plot; click to set the cc threshold. Seismograms
whose cross-correlation with the stack falls below this value will be
automatically de-selected when running ICCS with --autoselect.
Source code in src/aimbat/_cli/pick.py
cli_pick_timewindow
cli_pick_timewindow(
event_id: Annotated[UUID, event_parameter()],
*,
iccs_plot_parameters: IccsPlotParameters = IccsPlotParameters(),
use_matrix_image: Annotated[
bool, use_matrix_image()
] = False,
_: DebugParameter = DebugParameter(),
) -> None
Interactively pick a new cross-correlation time window for an event.
Opens an interactive plot; click to set the left and right window boundaries, then close the window to save. The window controls which portion of each seismogram is used during ICCS alignment.
Source code in src/aimbat/_cli/pick.py
cli_update_phase_pick
cli_update_phase_pick(
event_id: Annotated[UUID, event_parameter()],
*,
iccs_plot_parameters: IccsPlotParameters = IccsPlotParameters(),
use_matrix_image: Annotated[
bool, use_matrix_image()
] = False,
_: DebugParameter = DebugParameter(),
) -> None
Interactively pick a new phase arrival time (t1) for an event.
Opens an interactive plot; click to place the new pick, then close the window
to save. The pick is stored as t1 for each seismogram in the ICCS instance.
Source code in src/aimbat/_cli/pick.py
plot
Create plots for seismograms and ICCS results.
Available plots:
- data: raw seismograms sorted by epicentral distance.
- stack: the ICCS cross-correlation stack for an event.
- matrix: seismograms displayed as a matrix image.
Most plot commands support --context / --no-context to toggle extra
waveform context, and --all to include deselected seismograms.
Functions:
| Name | Description |
|---|---|
cli_plot_matrix_image |
Plot the ICCS seismograms of an event as a matrix image. |
cli_plot_stack |
Plot the ICCS stack of an event. |
cli_seismogram_plot |
Plot input seismograms in an event sorted by epicentral distance. |
cli_plot_matrix_image
cli_plot_matrix_image(
event_id: Annotated[UUID, event_parameter()],
*,
iccs_plot_parameters: IccsPlotParameters = IccsPlotParameters(),
_: DebugParameter = DebugParameter(),
) -> None
Plot the ICCS seismograms of an event as a matrix image.
The matrix is assembled from individual waveforms, with each row representing a different seismogram.
Source code in src/aimbat/_cli/plot.py
cli_plot_stack
cli_plot_stack(
event_id: Annotated[UUID, event_parameter()],
*,
iccs_plot_parameters: IccsPlotParameters = IccsPlotParameters(),
_: DebugParameter = DebugParameter(),
) -> None
Plot the ICCS stack of an event.
Source code in src/aimbat/_cli/plot.py
cli_seismogram_plot
cli_seismogram_plot(
event_id: Annotated[UUID, event_parameter()],
*,
_: DebugParameter = DebugParameter(),
) -> None
Plot input seismograms in an event sorted by epicentral distance.
Source code in src/aimbat/_cli/plot.py
project
Manage AIMBAT projects.
This command manages projects. By default, the project consists
of a file called aimbat.db in the current working directory. All aimbat
commands must be executed from the same directory. The location (and name) of
the project file may also be specified by setting the AIMBAT_PROJECT
environment variable to the desired filename. Alternatively, aimbat can be
executed with a database url directly.
Functions:
| Name | Description |
|---|---|
cli_project_create |
Create a new AIMBAT project in the current directory. |
cli_project_delete |
Delete project (note: this does not delete seismogram files). |
cli_project_info |
Show information on an existing project. |
cli_project_create
cli_project_create(
*, _: DebugParameter = DebugParameter()
) -> None
Create a new AIMBAT project in the current directory.
Initialises a new project database (aimbat.db by default). Run this
once before adding data with aimbat data add.
Source code in src/aimbat/_cli/project.py
cli_project_delete
cli_project_delete(
*, _: DebugParameter = DebugParameter()
) -> None
Delete project (note: this does not delete seismogram files).
Source code in src/aimbat/_cli/project.py
cli_project_info
cli_project_info(
event_id: Annotated[
UUID | None, event_parameter()
] = None,
*,
_: DebugParameter = DebugParameter(),
) -> None
Show information on an existing project.
Source code in src/aimbat/_cli/project.py
seismogram
View and manage seismograms in the AIMBAT project.
Functions:
| Name | Description |
|---|---|
cli_seismogram_delete |
Delete existing seismogram. |
cli_seismogram_dump |
Dump the contents of the AIMBAT seismogram table to JSON. |
cli_seismogram_list |
Print information on the seismograms in an event. |
cli_seismogram_note_edit |
Open the seismogram note in |
cli_seismogram_note_read |
Display the note attached to a seismogram, rendered as Markdown. |
cli_seismogram_parameter_dump |
Dump seismogram parameter table to json. |
cli_seismogram_parameter_get |
Get the value of a processing parameter. |
cli_seismogram_parameter_list |
List processing parameter values for seismograms in an event. |
cli_seismogram_parameter_reset |
Reset all processing parameters to their default values. |
cli_seismogram_parameter_set |
Set value of a processing parameter. |
cli_seismogram_delete
cli_seismogram_delete(
seismogram_id: Annotated[
UUID,
id_parameter(
AimbatSeismogram,
help="UUID (or unique prefix) of seismogram to delete.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Delete existing seismogram.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_dump
cli_seismogram_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump the contents of the AIMBAT seismogram table to JSON.
Output can be piped or redirected for use in external tools or scripts.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_list
cli_seismogram_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
Print information on the seismograms in an event.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_note_edit
cli_seismogram_note_edit(
seismogram_id: Annotated[
UUID,
id_parameter(
AimbatSeismogram,
help="UUID (or unique prefix) of seismogram.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Open the seismogram note in $EDITOR and save changes on exit.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_note_read
cli_seismogram_note_read(
seismogram_id: Annotated[
UUID,
id_parameter(
AimbatSeismogram,
help="UUID (or unique prefix) of seismogram.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Display the note attached to a seismogram, rendered as Markdown.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_parameter_dump
cli_seismogram_parameter_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump seismogram parameter table to json.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_parameter_get
cli_seismogram_parameter_get(
name: SeismogramParameter,
*,
seismogram_id: Annotated[
UUID,
id_parameter(
AimbatSeismogram,
help="UUID (or unique prefix) of seismogram to query.",
),
],
_: DebugParameter = DebugParameter(),
) -> None
Get the value of a processing parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
SeismogramParameter
|
Name of the seismogram parameter. |
required |
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_parameter_list
cli_seismogram_parameter_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
List processing parameter values for seismograms in an event.
Displays per-seismogram parameters (e.g. select, flip, t1 pick)
in a table. Use seismogram parameter set to modify individual values.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_parameter_reset
cli_seismogram_parameter_reset(
seismogram_id: Annotated[
UUID,
id_parameter(
AimbatSeismogram,
help="UUID (or unique prefix) of seismogram to reset parameters for.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Reset all processing parameters to their default values.
Source code in src/aimbat/_cli/seismogram.py
cli_seismogram_parameter_set
cli_seismogram_parameter_set(
name: SeismogramParameter,
value: str,
*,
seismogram_id: Annotated[
UUID,
id_parameter(
AimbatSeismogram,
help="UUID (or unique prefix) of seismogram to modify.",
),
],
_: DebugParameter = DebugParameter(),
) -> None
Set value of a processing parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
SeismogramParameter
|
Name of the seismogram parameter. |
required |
value
|
str
|
Value of the seismogram parameter. |
required |
Source code in src/aimbat/_cli/seismogram.py
shell
Interactive AIMBAT shell with tab-completion and command history.
All CLI commands are available. Press Tab to complete commands, Ctrl+D
or type exit to leave.
Shell-only commands
event switch [ID] Switch the shell's event context.
Functions:
| Name | Description |
|---|---|
cli_shell |
Start an interactive AIMBAT shell. |
cli_shell
cli_shell(
event_id: Annotated[
UUID | None,
event_parameter(
help="Start the shell in the context of a specific event. Full UUID or any unique prefix as shown in the table. "
),
] = None,
*,
_: DebugParameter = DebugParameter(),
) -> None
Start an interactive AIMBAT shell.
Source code in src/aimbat/_cli/shell.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
snapshot
View and manage snapshots of processing parameters.
A snapshot captures the current event and seismogram processing parameters
(e.g. time window, bandpass filter, picks) so they can be restored later.
Use snapshot create before making experimental changes, and snapshot rollback
to undo them if needed.
Functions:
| Name | Description |
|---|---|
cli_snapshot_create |
Create a new snapshot of current processing parameters. |
cli_snapshot_delete |
Delete existing snapshot. |
cli_snapshot_details |
Print information on the event parameters saved in a snapshot. |
cli_snapshot_dump |
Dump the contents of the AIMBAT snapshot tables to json. |
cli_snapshot_list |
Print information on the snapshots for an event. |
cli_snapshot_note_edit |
Open the snapshot note in |
cli_snapshot_note_read |
Display the note attached to a snapshot, rendered as Markdown. |
cli_snapshot_preview |
Preview the ICCS stack/matrix of a snapshot. |
cli_snapshot_quality_dump |
Dump snapshot quality statistics to JSON. |
cli_snapshot_quality_list |
Show aggregated quality statistics for snapshots of an event or all events. |
cli_snapshot_rollback |
Rollback to snapshot. |
cli_snapshot_create
cli_snapshot_create(
event_id: Annotated[UUID, event_parameter()],
comment: str | None = None,
*,
_: DebugParameter = DebugParameter(),
) -> None
Create a new snapshot of current processing parameters.
Saves the current event and seismogram parameters for an event so
they can be restored later with snapshot rollback.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
comment
|
str | None
|
Optional description to help identify this snapshot later. |
None
|
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_delete
cli_snapshot_delete(
snapshot_id: Annotated[
UUID,
id_parameter(
AimbatSnapshot,
help="UUID (or unique prefix) of snapshot to delete.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Delete existing snapshot.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_details
cli_snapshot_details(
snapshot_id: Annotated[
UUID,
id_parameter(
AimbatSnapshot,
help="UUID (or unique prefix) of snapshot to show details for.",
),
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
Print information on the event parameters saved in a snapshot.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_dump
cli_snapshot_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump the contents of the AIMBAT snapshot tables to json.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_list
cli_snapshot_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
Print information on the snapshots for an event.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_note_edit
cli_snapshot_note_edit(
snapshot_id: Annotated[
UUID,
id_parameter(
AimbatSnapshot,
help="UUID (or unique prefix) of snapshot.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Open the snapshot note in $EDITOR and save changes on exit.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_note_read
cli_snapshot_note_read(
snapshot_id: Annotated[
UUID,
id_parameter(
AimbatSnapshot,
help="UUID (or unique prefix) of snapshot.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Display the note attached to a snapshot, rendered as Markdown.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_preview
cli_snapshot_preview(
snapshot_id: Annotated[
UUID,
id_parameter(
AimbatSnapshot,
help="UUID (or unique prefix) of snapshot to preview.",
),
],
*,
iccs_plot_parameters: IccsPlotParameters = IccsPlotParameters(),
as_matrix: Annotated[
bool, Parameter(name=matrix)
] = False,
_: DebugParameter = DebugParameter(),
) -> None
Preview the ICCS stack/matrix of a snapshot.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_quality_dump
cli_snapshot_quality_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump snapshot quality statistics to JSON.
Output can be piped or redirected for use in external tools or scripts.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_quality_list
cli_snapshot_quality_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
Show aggregated quality statistics for snapshots of an event or all events.
Displays ICCS and MCCC quality metrics (means, SEMs, RMSE) from the frozen quality records of each snapshot.
Source code in src/aimbat/_cli/snapshot.py
cli_snapshot_rollback
cli_snapshot_rollback(
snapshot_id: Annotated[
UUID,
id_parameter(
AimbatSnapshot,
help="UUID (or unique prefix) of snapshot to use for rollback.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Rollback to snapshot.
Source code in src/aimbat/_cli/snapshot.py
station
View and manage stations.
Functions:
| Name | Description |
|---|---|
cli_station_delete |
Delete existing station (for all events). |
cli_station_dump |
Dump the contents of the AIMBAT station table to JSON. |
cli_station_list |
Print information on the stations used in an event. |
cli_station_note_edit |
Open the station note in |
cli_station_note_read |
Display the note attached to a station, rendered as Markdown. |
cli_station_quality_dump |
Dump station quality statistics to JSON. |
cli_station_quality_list |
Show aggregated quality statistics for a station or all stations. |
cli_station_seismograms_plot |
Plot input seismograms for events recorded at this station. |
cli_station_delete
cli_station_delete(
station_id: Annotated[
UUID,
id_parameter(
AimbatStation,
help="UUID (or unique prefix) of station to delete.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Delete existing station (for all events).
Source code in src/aimbat/_cli/station.py
cli_station_dump
cli_station_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump the contents of the AIMBAT station table to JSON.
Output can be piped or redirected for use in external tools or scripts.
Source code in src/aimbat/_cli/station.py
cli_station_list
cli_station_list(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
table_parameters: TableParameters = TableParameters(),
) -> None
Print information on the stations used in an event.
Source code in src/aimbat/_cli/station.py
cli_station_note_edit
cli_station_note_edit(
station_id: Annotated[
UUID,
id_parameter(
AimbatStation,
help="UUID (or unique prefix) of station.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Open the station note in $EDITOR and save changes on exit.
Source code in src/aimbat/_cli/station.py
cli_station_note_read
cli_station_note_read(
station_id: Annotated[
UUID,
id_parameter(
AimbatStation,
help="UUID (or unique prefix) of station.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Display the note attached to a station, rendered as Markdown.
Source code in src/aimbat/_cli/station.py
cli_station_quality_dump
cli_station_quality_dump(
*,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Dump station quality statistics to JSON.
Output can be piped or redirected for use in external tools or scripts.
Source code in src/aimbat/_cli/station.py
cli_station_quality_list
cli_station_quality_list(
station_id: Annotated[
UUID | Literal["all"], station_parameter_with_all()
],
*,
table_parameters: TableParameters = TableParameters(),
) -> None
Show aggregated quality statistics for a station or all stations.
Displays ICCS and MCCC quality metrics (means, SEMs) aggregated across all seismograms of each station.
Source code in src/aimbat/_cli/station.py
cli_station_seismograms_plot
cli_station_seismograms_plot(
station_id: Annotated[
UUID,
id_parameter(
AimbatStation,
help="UUID (or unique prefix) of station to plot seismograms for.",
),
],
*,
_: DebugParameter = DebugParameter(),
) -> None
Plot input seismograms for events recorded at this station.
Source code in src/aimbat/_cli/station.py
utils
Utilities for AIMBAT.
Modules:
| Name | Description |
|---|---|
app |
Utilities for AIMBAT. |
sampledata |
Download or delete AIMBAT sample data. |
app
Utilities for AIMBAT.
The utils subcommand contains useful tools that are not strictly part of an AIMBAT workflow.
sampledata
Download or delete AIMBAT sample data.
The sampledata subcommand manages an example dataset that can be used for testing or learning how to use AIMBAT.
The sample data source url can be viewed or changed via aimbat default
<list/set> sampledata_src. Likewise the sample data destination folder
be viewed or changed via aimbat default <list/set> sampledata_dir.
Functions:
| Name | Description |
|---|---|
sampledata_cli_delete |
Recursively delete sample data directory. |
sampledata_cli_download |
Download AIMBAT sample data. |
sampledata_cli_delete
sampledata_cli_delete(
*, _: DebugParameter = DebugParameter()
) -> None
Recursively delete sample data directory.
Source code in src/aimbat/_cli/utils/sampledata.py
sampledata_cli_download
sampledata_cli_download(
*,
force: Annotated[
bool,
Parameter(
help="Delete the download directory and re-download"
),
] = False,
_: DebugParameter = DebugParameter(),
) -> None
Download AIMBAT sample data.
Downloads an example dataset to the directory specified in the
sampledata_dir AIMBAT default variable.