aimbat._cli
Cyclopts command groups for the AIMBAT CLI, re-exported for aimbat.app.
Modules:
| Name | Description |
|---|---|
align |
Align seismograms using ICCS or MCCC. |
common |
Shared decorators, parameters, and table formatting for CLI command modules. |
data |
Manage data sources in an AIMBAT project. |
db |
Manage the AIMBAT project database schema. |
event |
View and manage events in the AIMBAT project. |
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. |
tool |
Launch interactive tools for picking phase arrival times and processing parameters. |
tui |
Launch the AIMBAT terminal user interface. |
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
Shared decorators, parameters, and table formatting for CLI command modules.
Classes:
| Name | Description |
|---|---|
ConfirmParameters |
Shared parameters for destructive commands ( |
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 |
|---|---|
causal |
Return a cyclopts |
confirm_or_abort |
Prompt for confirmation before a destructive action, then abort if declined. |
event_parameter |
Return a cyclopts |
event_parameter_is_all |
Return |
event_parameter_with_all |
Return a cyclopts |
event_table_title |
Title for a table of records belonging to one event. |
handle_issues |
Decorator that reports exceptions to the console and exits cleanly. |
id_label |
Render a record's ID the way a table title shows it. |
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. |
make_note_app |
Build the |
open_in_editor |
Write |
print_error_panel |
Print an exception to the console in a red panel. |
print_json_dump |
Print a table dump as JSON, in its own database session. |
print_quality_table |
Print one of the aggregated quality tables. |
print_warning |
Print a non-fatal warning message to the console, styled yellow. |
run_reporting_issues |
Run |
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 |
Attributes:
| Name | Type | Description |
|---|---|---|
CAUSAL_DEFAULTS |
dict[str, bool]
|
Default causal/zero-phase setting per |
CAUSAL_DEFAULTS
module-attribute
Default causal/zero-phase setting per tool subcommand and TUI tool id.
Single source of truth for the causal() parameter defaults in
_cli/tool.py and the equivalent per-tool defaults in the TUI's
InteractiveToolsModal (_tui/modals.py).
ConfirmParameters
dataclass
Bases: _YesTrait, _DebugTrait
Shared parameters for destructive commands (--yes, --debug).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
debug
|
bool
|
Enable verbose logging for troubleshooting. |
False
|
yes
|
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.
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.
causal
Return a cyclopts Parameter for switching between causal and zero-phase filtering.
Source code in src/aimbat/_cli/common/_parameters.py
confirm_or_abort
Prompt for confirmation before a destructive action, then abort if declined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
The Yes/No question to display. |
required |
yes
|
bool
|
If True, skip the prompt (for scripting/non-interactive use). |
required |
Raises:
| Type | Description |
|---|---|
SystemExit
|
With status 0, if the user declines or the prompt cannot be read (e.g. no interactive terminal is attached). |
Source code in src/aimbat/_cli/common/_decorators.py
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
event_table_title
event_table_title(
session: Session,
event: AimbatEvent,
*,
subject: str,
raw: bool,
) -> str
Title for a table of records belonging to one event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
event
|
AimbatEvent
|
The event the records belong to. |
required |
subject
|
str
|
Plural noun for what the table lists, e.g. |
required |
raw
|
bool
|
If |
required |
Source code in src/aimbat/_cli/common/_table.py
handle_issues
Decorator that reports exceptions to the console and exits cleanly.
Exceptions raised by the wrapped command are printed (without traceback)
in a red panel, then the process exits with status 1. Any
aimbat.core.SchemaStaleWarning raised during the call is always
promoted to an error first, so a stale database schema is reported
through the same red-panel path as any other failure, regardless of
AIMBAT_STRICT_SCHEMA_CHECK.
In debugging mode (AIMBAT_LOG_LEVEL=DEBUG or TRACE), the schema
staleness promotion still applies, but exceptions are no longer caught
and rendered as a panel; they propagate as a normal Python traceback
instead.
Source code in src/aimbat/_cli/common/_decorators.py
id_label
Render a record's ID the way a table title shows it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
model
|
type[AimbatTypes]
|
Model the ID belongs to, used to shorten it unambiguously. |
required |
record_id
|
UUID | str
|
The ID to render. |
required |
raw
|
bool
|
If |
required |
Source code in src/aimbat/_cli/common/_table.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
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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
make_note_app
make_note_app(
target: NoteTarget,
model: type[AimbatTypes],
parameter: Parameter,
) -> App
Build the note sub-app (read and edit) for one kind of record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
NoteTarget
|
The kind of record the notes belong to, also the noun used in the commands' help text. |
required |
model
|
type[AimbatTypes]
|
Model class the note is attached to. |
required |
parameter
|
Parameter
|
cyclopts parameter that selects the record to act on. |
required |
Source code in src/aimbat/_cli/common/_notes.py
open_in_editor
Write initial_content to a temporary Markdown file, open it in $EDITOR.
Returns the (possibly updated) content after the editor exits. The temporary file is not removed until then, since Windows does not allow a second process to open a file that is already open.
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
print_json_dump
print_json_dump(dump: TableDump, *, by_alias: bool) -> None
Print a table dump as JSON, in its own database session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dump
|
TableDump
|
The |
required |
by_alias
|
bool
|
Whether to key the records by field alias. |
required |
Source code in src/aimbat/_cli/common/_table.py
print_quality_table
print_quality_table(
session: Session,
dump: TableDump,
*,
title: str,
filter_id: UUID | None,
id_field: str,
id_columns: dict[str, type[AimbatTypes]],
raw: bool,
) -> None
Print one of the aggregated quality tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
Database session. |
required |
dump
|
TableDump
|
The |
required |
title
|
str
|
Table title. |
required |
filter_id
|
UUID | None
|
Restrict the table to this record, or |
required |
id_field
|
str
|
Name of |
required |
id_columns
|
dict[str, type[AimbatTypes]]
|
The ID columns to shorten, mapped to the model each belongs to. |
required |
raw
|
bool
|
If |
required |
Source code in src/aimbat/_cli/common/_table.py
print_warning
print_warning(message: object) -> None
Print a non-fatal warning message to the console, styled yellow.
Source code in src/aimbat/_cli/common/_decorators.py
run_reporting_issues
run_reporting_issues(func: Callable[[], T]) -> T
Run func, reporting exceptions to the console the same way handle_issues does.
Exists so code that runs outside a handle_issues-wrapped command body -
currently the UUID-prefix converters in common/_parameters.py, which
cyclopts calls during argument parsing, before the command function
itself is invoked - gets the same styled-panel / debug-mode-passthrough
behaviour instead of a raw, unstyled traceback.
Any aimbat.core.SchemaStaleWarning raised during the call is always
promoted to an error first, so a stale database schema is reported
through the same red-panel path as any other failure, regardless of
AIMBAT_STRICT_SCHEMA_CHECK.
In debugging mode (AIMBAT_LOG_LEVEL=DEBUG/TRACE, or a --debug flag
on the command line), the schema staleness promotion still applies, but
exceptions are no longer caught and rendered as a panel; they propagate
as a normal Python traceback instead.
A converter runs while cyclopts is still parsing arguments, before it
constructs the _DebugTrait-derived dataclass whose __post_init__
would otherwise set settings.log_level from --debug - that dataclass
is only built once every field, including this one, has already
converted successfully. So sys.argv is checked directly for --debug
here as well, rather than relying solely on settings.log_level.
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 where AIMBAT reads seismogram waveforms and metadata from.
Every current data type is a file, but a data source need not be one; it is
identified by an opaque sourcename. 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
Re-adding a data source that is already in the project is safe: existing records are reused rather than duplicated.
Near-duplicate events (two files whose origin times differ by only a
sliver, most often from precision loss upstream such as SAC's o-header
32-bit float, rather than genuinely distinct events) are merged onto the
pre-existing event rather than turned into a second one. Merging is always
first-wins: the new data links to the pre-existing event's stored time and
location exactly as they already are, never merging, averaging, or
recomputing from the new file. Detection is controlled by
event_duplicate_tolerance (below this, a gap is assumed to be ordinary
precision noise and the existing event is reused with a warning),
event_duplicate_raise_tolerance (above event_duplicate_tolerance but
below this, a gap is treated as a likely data problem and always raises,
even during --dry-run; resolve it with --use-event <uuid> to link to
the pre-existing event explicitly), and event_duplicate_strict (skips
both checks entirely; with it set, events are only ever merged on an exact
origin-time match, which is itself only accurate to the microsecond AIMBAT
stores timestamps at, so any gap of a microsecond or more silently creates
a second event).
data add automatically creates a snapshot for each event that received new
seismogram data, so there is no need to run snapshot create right after
ingestion (pass --no-snapshot to opt out for a given invocation). Use
snapshot create later for deliberate checkpoints, e.g. before trying an
experimental parameter change.
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_prune |
Delete seismograms whose data source has vanished. |
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, dir_okay=False),
),
],
*,
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,
auto_snapshot: Annotated[
bool,
Parameter(
name="snapshot",
help="Automatically create a snapshot for each event that received new "
+ "seismogram data.",
),
] = 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. Use --no-snapshot to skip the automatic post-ingestion
snapshot for this invocation.
Note --dry-run can still raise rather than produce a clean preview: an
"ambiguous gap" near-duplicate event (see the module help above) is
flagged as an error unconditionally, since it usually signals a data
problem worth stopping for even during a preview.
Source code in src/aimbat/_cli/data.py
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 | |
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
cli_data_prune
cli_data_prune(
event_id: Annotated[
UUID | Literal["all"], event_parameter_with_all()
],
*,
dry_run: Annotated[
bool,
Parameter(
name="dry-run",
help="Show what would be pruned without deleting anything.",
),
] = False,
force: Annotated[
bool,
Parameter(
help="Treat a source whose presence cannot be determined (an "
+ "unreadable file, a missing parent directory, an unreachable "
+ "mount) as vanished instead of stopping."
),
] = False,
prune_empty_stations: Annotated[
bool,
Parameter(
name="prune-empty-stations",
help="Also delete stations left with no seismograms.",
),
] = False,
prune_empty_events: Annotated[
bool,
Parameter(
name="prune-empty-events",
help="Also delete events left with no seismograms. This permanently "
+ "destroys those events' snapshot history.",
),
] = False,
auto_snapshot: Annotated[
bool,
Parameter(
name="snapshot",
help="Snapshot every affected event before pruning.",
),
] = True,
confirm: ConfirmParameters = ConfirmParameters(),
) -> None
Delete seismograms whose data source has vanished.
Reconciles the project with reality after a waveform source is removed (a SAC file deleted, a directory moved). Each seismogram whose source can no longer be read is deleted, along with its data source, parameters, and quality records. Frozen snapshot history is preserved.
prune never deletes anything the source still provides. To remove a
seismogram whose data still exist, remove it from the source directory
first; to exclude one from analysis without deleting it, set select =
False instead.
Always run with --dry-run first: prune cannot tell a relocated file
from a deleted one. Pass --prune-empty-stations / --prune-empty-events
to also clean up stations or events left with no seismograms.
Source code in src/aimbat/_cli/data.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 | |
db
Manage the AIMBAT project database schema.
Schema changes are applied via Alembic.
Most users never need this command group: aimbat project create already
creates a database with the current schema. It exists for bringing an
existing project database up to date after an AIMBAT upgrade that changed
the schema, including databases created before this command group existed.
Functions:
| Name | Description |
|---|---|
cli_db_current |
Show the schema version the project database is currently at. |
cli_db_upgrade |
Upgrade the project database to the latest schema version. |
cli_db_current
cli_db_current(
*, _: DebugParameter = DebugParameter()
) -> None
Show the schema version the project database is currently at.
Source code in src/aimbat/_cli/db.py
cli_db_upgrade
cli_db_upgrade(
*, _: DebugParameter = DebugParameter()
) -> None
Upgrade the project database to the latest schema version.
Safe to run on a database that is already up to date (does nothing) or on one that predates Alembic (verifies its schema matches before stamping it, then upgrades).
Source code in src/aimbat/_cli/db.py
event
View and manage events in the AIMBAT project.
Functions:
| Name | Description |
|---|---|
cli_event_delete |
Delete an 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_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()],
*,
confirm: ConfirmParameters = ConfirmParameters(),
) -> None
Delete an existing event.
Cascades to all of the event's seismograms (with their data sources, parameters, and quality records) and to every snapshot taken for it.
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_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 |
event_debug_parameters
|
EventDebugParameters
|
Event context and debug mode. |
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 |
event_debug_parameters
|
EventDebugParameters
|
Event context and debug mode. |
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
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.
stack and matrix build an ICCS instance to plot from, which writes the
resulting cross-correlation values to the project database (the same
live-quality write every ICCS-consuming command makes) - despite being
read-only from the user's point of view, they do write to the database.
Each command closes its database session before the plot window opens, so an open plot holds no database connection.
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. Building the ICCS instance writes each seismogram's cross-correlation value to the project database, so this command writes to the database despite being read-only from the user's point of view.
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.
Building the ICCS instance writes each seismogram's cross-correlation value to the project database, so this command writes to the database despite being read-only from the user's point of view.
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 the AIMBAT project database. |
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(
*, confirm: ConfirmParameters = ConfirmParameters()
) -> None
Delete the AIMBAT project database.
Does not delete the underlying seismogram data source 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
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 | |
seismogram
View and manage seismograms in the AIMBAT project.
Functions:
| Name | Description |
|---|---|
cli_seismogram_delete |
Delete an 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_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.",
),
],
*,
confirm: ConfirmParameters = ConfirmParameters(),
) -> None
Delete an existing seismogram.
Cascades to its data source, processing parameters, and quality record. Also removes this seismogram's parameter and quality data from every snapshot that recorded it, including snapshots taken before deletion.
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_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 |
seismogram_id
|
Annotated[UUID, id_parameter(AimbatSeismogram, help='UUID (or unique prefix) of seismogram to query.')]
|
UUID (or unique prefix) of the seismogram to query. |
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 |
seismogram_id
|
Annotated[UUID, id_parameter(AimbatSeismogram, help='UUID (or unique prefix) of seismogram to modify.')]
|
UUID (or unique prefix) of the seismogram to modify. |
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
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 286 287 288 289 290 291 292 293 294 | |
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 an 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_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_results |
Export per-seismogram MCCC results from a snapshot as JSON. |
cli_snapshot_rollback |
Restore saved parameters from a snapshot as the current live values. |
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 |
|---|---|---|---|
event_id
|
Annotated[UUID, event_parameter()]
|
UUID (or unique prefix) of the event to snapshot. |
required |
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.",
),
],
*,
confirm: ConfirmParameters = ConfirmParameters(),
) -> None
Delete an existing snapshot.
Only removes the snapshot's frozen parameter and quality records; current event and seismogram data are unaffected.
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_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_results
cli_snapshot_results(
snapshot_id: Annotated[
UUID,
id_parameter(
AimbatSnapshot,
help="UUID (or unique prefix) of snapshot.",
),
],
*,
output: Annotated[
Path | None,
Parameter(
name=output,
help="Write results to this JSON file instead of printing to stdout.",
validator=Path(dir_okay=False),
),
] = None,
force: Annotated[
bool,
Parameter(
help="Overwrite `--output` if it already exists."
),
] = False,
dump_parameters: JsonDumpParameters = JsonDumpParameters(),
) -> None
Export per-seismogram MCCC results from a snapshot as JSON.
Each row contains the frozen pick time (T1), ICCS correlation coefficient, per-seismogram MCCC quality metrics, and the event-level MCCC RMSE.
Results are printed to stdout unless --output is given, in which case
they are written to the specified file.
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.",
),
],
*,
confirm: ConfirmParameters = ConfirmParameters(),
) -> None
Restore saved parameters from a snapshot as the current live values.
Overwrites the current event and per-seismogram parameters for the event with those recorded in the snapshot. Any ICCS runs or parameter changes made after the snapshot was taken are undone. The snapshot itself is not deleted, so you can roll back to it again.
If the snapshot has MCCC quality data, the live quality metrics are also restored from the best matching snapshot (same parameter hash, most recent MCCC run).
Source code in src/aimbat/_cli/snapshot.py
station
View and manage stations.
Functions:
| Name | Description |
|---|---|
cli_station_delete |
Delete an existing station. |
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_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.",
),
],
*,
confirm: ConfirmParameters = ConfirmParameters(),
) -> None
Delete an existing station.
Cascades to every seismogram recorded at this station across all events, including their data sources, parameters, quality records, and snapshot history.
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_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
tool
Launch interactive tools for picking phase arrival times and processing parameters.
Each subcommand opens an interactive matplotlib plot for an event. Use
--event-id or set the DEFAULT_EVENT_ID environment variable to choose
which event to work with. Interact with the plot (click or scroll, depending
on the tool) to set the chosen value, then close the window to save it.
The database session is closed before the window opens, and a new one is opened to save the new value once it closes, so an open plot holds no database connection.
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_bandpass |
Interactively update the bandpass filter parameters 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,
causal: Annotated[bool, causal()] = CAUSAL_DEFAULTS[
"cc"
],
_: DebugParameter = DebugParameter(),
) -> None
Interactively pick a new minimum cross-correlation for auto-selection.
Opens an interactive plot; scroll 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/tool.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,
causal: Annotated[bool, causal()] = CAUSAL_DEFAULTS[
"window"
],
_: 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/tool.py
cli_update_bandpass
cli_update_bandpass(
event_id: Annotated[UUID, event_parameter()],
*,
iccs_plot_parameters: IccsPlotParameters = IccsPlotParameters(),
use_matrix_image: Annotated[
bool, use_matrix_image()
] = False,
_: DebugParameter = DebugParameter(),
) -> None
Interactively update the bandpass filter parameters for an event.
Opens an interactive plot with controls for enabling/disabling the bandpass filter and adjusting the minimum and maximum frequencies. Close the window to save the updated parameters.
Source code in src/aimbat/_cli/tool.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,
causal: Annotated[bool, causal()] = CAUSAL_DEFAULTS[
"phase"
],
_: 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/tool.py
tui
Launch the AIMBAT terminal user interface.
Functions:
| Name | Description |
|---|---|
cli_tui |
Launch the AIMBAT terminal user interface. |
cli_tui
cli_tui(*, _: DebugParameter = DebugParameter()) -> None
Launch the AIMBAT terminal user interface.
Source code in src/aimbat/_cli/tui.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 destination folder can be viewed with aimbat utils
settings and changed by setting AIMBAT_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(
*, confirm: ConfirmParameters = ConfirmParameters()
) -> 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,
confirm: ConfirmParameters = ConfirmParameters(),
) -> None
Download AIMBAT sample data.
Downloads an example dataset to the directory specified in the
sampledata_dir AIMBAT default variable.