aimbat.cli
Modules:
| Name | Description |
|---|---|
common |
Common parameters and functions for the AIMBAT CLI. |
data |
Manage seismogram files in an AIMBAT project. |
event |
View and manage events in the AIMBAT project. |
iccs |
ICCS processing tools. |
project |
Manage AIMBAT projects. |
seismogram |
View and manage seismograms in the AIMBAT project. |
snapshot |
View and manage snapshots. |
station |
View and manage stations. |
utils |
Utilities for AIMBAT. |
common
Common parameters and functions for the AIMBAT CLI.
Classes:
| Name | Description |
|---|---|
GlobalParameters |
|
TableParameters |
|
Functions:
| Name | Description |
|---|---|
simple_exception |
Decorator to handle exceptions and print them to the console. |
GlobalParameters
dataclass
TableParameters
dataclass
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.py
data
Manage seismogram files in an AIMBAT project.
Functions:
| Name | Description |
|---|---|
cli_data_add |
Add or update data files in the AIMBAT project. |
cli_data_dump |
Dump the contents of the AIMBAT data table to json. |
cli_data_list |
Print information on the data stored in AIMBAT. |
cli_data_add
cli_data_add(
seismogram_files: Annotated[
list[Path],
Parameter(
name=files,
consume_multiple=True,
validator=Path(exists=True),
),
],
*,
filetype: DataType = SAC,
show_progress_bar: Annotated[
bool, Parameter(name=progress)
] = True,
global_parameters: GlobalParameters | None = None
) -> None
Add or update data files in the AIMBAT project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seismogram_files
|
Annotated[list[Path], Parameter(name=files, consume_multiple=True, validator=Path(exists=True))]
|
Seismogram files to be added. |
required |
filetype
|
DataType
|
Specify type of seismogram file. |
SAC
|
show_progress_bar
|
Annotated[bool, Parameter(name=progress)]
|
Display progress bar. |
True
|
Source code in src/aimbat/cli/data.py
cli_data_dump
cli_data_dump(
*, global_parameters: GlobalParameters | None = None
) -> None
Dump the contents of the AIMBAT data table to json.
Source code in src/aimbat/cli/data.py
cli_data_list
cli_data_list(
*,
all_events: Annotated[
bool, Parameter(name=all)
] = False,
table_parameters: TableParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Print information on the data stored in AIMBAT.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_events
|
Annotated[bool, Parameter(name=all)]
|
Select data for all events. |
False
|
Source code in src/aimbat/cli/data.py
event
View and manage events in the AIMBAT project.
Functions:
| Name | Description |
|---|---|
cli_event_activate |
Select the event to be active for Processing. |
cli_event_delete |
Delete existing event. |
cli_event_dump |
Dump the contents of the AIMBAT event table to json. |
cli_event_list |
Print information on the events stored in AIMBAT. |
cli_event_parameter_get |
Get parameter value for the active event. |
cli_event_parameter_set |
Set parameter value for the active event. |
cli_event_activate
cli_event_activate(
event_id: Annotated[UUID | str, Parameter(name=id)],
*,
global_parameters: GlobalParameters | None = None
) -> None
Select the event to be active for Processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Event ID number. |
required |
Source code in src/aimbat/cli/event.py
cli_event_delete
cli_event_delete(
event_id: Annotated[UUID | str, Parameter(name=id)],
*,
global_parameters: GlobalParameters | None = None
) -> None
Delete existing event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Event ID. |
required |
Source code in src/aimbat/cli/event.py
cli_event_dump
cli_event_dump(
*, global_parameters: GlobalParameters | None = None
) -> None
Dump the contents of the AIMBAT event table to json.
Source code in src/aimbat/cli/event.py
cli_event_list
cli_event_list(
*,
table_parameters: TableParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Print information on the events stored in AIMBAT.
Source code in src/aimbat/cli/event.py
cli_event_parameter_get
cli_event_parameter_get(
name: EventParameter,
*,
global_parameters: GlobalParameters | None = None
) -> None
Get parameter value for the active event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
EventParameter
|
Event parameter name. |
required |
Source code in src/aimbat/cli/event.py
cli_event_parameter_set
cli_event_parameter_set(
name: EventParameter,
value: timedelta | str,
*,
global_parameters: GlobalParameters | None = None
) -> None
Set parameter value for the active event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
EventParameter
|
Event parameter name. |
required |
value
|
timedelta | str
|
Event parameter value. |
required |
Source code in src/aimbat/cli/event.py
iccs
ICCS processing tools.
Launches various processing tools related to ICCS.
Classes:
| Name | Description |
|---|---|
IccsPlotParameters |
|
Functions:
| Name | Description |
|---|---|
cli_iccs_plot_seismograms |
Plot the ICCS seismograms of the active event as an image. |
cli_iccs_plot_stack |
Plot the ICCS stack of the active event. |
cli_iccs_run |
Run the ICCS algorithm. |
cli_iccs_update_min_ccnorm |
Pick a new minimum cross-correlation norm for auto-selection. |
cli_iccs_update_pick |
Pick a new arrival time. |
cli_iccs_update_timewindow |
Pick a new time window. |
IccsPlotParameters
dataclass
cli_iccs_plot_seismograms
cli_iccs_plot_seismograms(
*,
iccs_parameters: IccsPlotParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Plot the ICCS seismograms of the active event as an image.
Source code in src/aimbat/cli/iccs.py
cli_iccs_plot_stack
cli_iccs_plot_stack(
*,
iccs_parameters: IccsPlotParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Plot the ICCS stack of the active event.
Source code in src/aimbat/cli/iccs.py
cli_iccs_run
cli_iccs_run(
*,
autoflip: bool = False,
autoselect: bool = False,
global_parameters: GlobalParameters | None = None
) -> None
Run the ICCS algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
autoflip
|
bool
|
Whether to automatically flip seismograms (multiply data by -1). |
False
|
autoselect
|
bool
|
Whether to automatically de-select seismograms. |
False
|
Source code in src/aimbat/cli/iccs.py
cli_iccs_update_min_ccnorm
cli_iccs_update_min_ccnorm(
*,
iccs_parameters: IccsPlotParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Pick a new minimum cross-correlation norm for auto-selection.
Source code in src/aimbat/cli/iccs.py
cli_iccs_update_pick
cli_iccs_update_pick(
*,
iccs_parameters: IccsPlotParameters | None = None,
use_seismogram_image: Annotated[
bool, Parameter(name=img)
] = False,
global_parameters: GlobalParameters | None = None
) -> None
Pick a new arrival time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
use_seismogram_image
|
Annotated[bool, Parameter(name=img)]
|
Use the seismogram image to update pick. |
False
|
Source code in src/aimbat/cli/iccs.py
cli_iccs_update_timewindow
cli_iccs_update_timewindow(
*,
iccs_parameters: IccsPlotParameters | None = None,
use_seismogram_image: Annotated[
bool, Parameter(name=img)
] = False,
global_parameters: GlobalParameters | None = None
) -> None
Pick a new time window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
use_seismogram_image
|
Annotated[bool, Parameter(name=img)]
|
Use the seismogram image to pick the time window. |
False
|
Source code in src/aimbat/cli/iccs.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 new AIMBAT project. |
cli_project_delete |
Delete project (note: this does not delete seismogram files). |
cli_project_info |
Show information on an exisiting project. |
cli_project_create
cli_project_create(
*, global_parameters: GlobalParameters | None = None
) -> None
Create new AIMBAT project.
cli_project_delete
cli_project_delete(
*, global_parameters: GlobalParameters | None = None
) -> None
Delete project (note: this does not delete seismogram files).
Source code in src/aimbat/cli/project.py
cli_project_info
cli_project_info(
*, global_parameters: GlobalParameters | None = None
) -> None
Show information on an exisiting 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_get |
Get the value of a processing parameter. |
cli_seismogram_list |
Print information on the seismograms in the active event. |
cli_seismogram_plot |
Plot seismograms for the active event. |
cli_seismogram_set |
Set value of a processing parameter. |
cli_seismogram_delete
cli_seismogram_delete(
seismogram_id: Annotated[
UUID | str, Parameter(name=id)
],
*,
global_parameters: GlobalParameters | None = None
) -> None
Delete existing seismogram.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seismogram_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Seismogram ID. |
required |
Source code in src/aimbat/cli/seismogram.py
cli_seismogram_dump
cli_seismogram_dump(
*, global_parameters: GlobalParameters | None = None
) -> None
Dump the contents of the AIMBAT seismogram table to json.
Source code in src/aimbat/cli/seismogram.py
cli_seismogram_get
cli_seismogram_get(
seismogram_id: Annotated[
UUID | str, Parameter(name=id)
],
name: SeismogramParameter,
*,
global_parameters: GlobalParameters | None = None
) -> None
Get the value of a processing parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seismogram_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Seismogram ID number. |
required |
name
|
SeismogramParameter
|
Name of the seismogram parameter. |
required |
Source code in src/aimbat/cli/seismogram.py
cli_seismogram_list
cli_seismogram_list(
*,
all_events: Annotated[bool, Parameter(all)] = False,
table_parameters: TableParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Print information on the seismograms in the active event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_events
|
Annotated[bool, Parameter(all)]
|
Select seismograms for all events. |
False
|
Source code in src/aimbat/cli/seismogram.py
cli_seismogram_plot
cli_seismogram_plot(
*, global_parameters: GlobalParameters | None = None
) -> None
Plot seismograms for the active event.
Source code in src/aimbat/cli/seismogram.py
cli_seismogram_set
cli_seismogram_set(
seismogram_id: Annotated[
UUID | str, Parameter(name=id)
],
name: SeismogramParameter,
value: str,
*,
global_parameters: GlobalParameters | None = None
) -> None
Set value of a processing parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seismogram_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Seismogram ID number. |
required |
name
|
SeismogramParameter
|
Name of the seismogram parameter. |
required |
value
|
str
|
Value of the seismogram parameter. |
required |
Source code in src/aimbat/cli/seismogram.py
snapshot
View and manage snapshots.
Functions:
| Name | Description |
|---|---|
cli_snapshop_delete |
Delete existing snapshot. |
cli_snapshot_create |
Create new snapshot. |
cli_snapshot_list |
Print information on the snapshots for the active event. |
cli_snapshot_rollback |
Rollback to snapshot. |
cli_snapshop_delete
cli_snapshop_delete(
snapshot_id: Annotated[UUID | str, Parameter(name=id)],
*,
global_parameters: GlobalParameters | None = None
) -> None
Delete existing snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Snapshot ID Number. |
required |
Source code in src/aimbat/cli/snapshot.py
cli_snapshot_create
cli_snapshot_create(
comment: str | None = None,
*,
global_parameters: GlobalParameters | None = None
) -> None
Create new snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
comment
|
str | None
|
Create snapshot with optional comment. |
None
|
Source code in src/aimbat/cli/snapshot.py
cli_snapshot_list
cli_snapshot_list(
*,
all_events: Annotated[bool, Parameter(all)] = False,
table_parameters: TableParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Print information on the snapshots for the active event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_events
|
Annotated[bool, Parameter(all)]
|
Select snapshots for all events. |
False
|
Source code in src/aimbat/cli/snapshot.py
cli_snapshot_rollback
cli_snapshot_rollback(
snapshot_id: Annotated[UUID | str, Parameter(name=id)],
*,
global_paramaters: GlobalParameters | None = None
) -> None
Rollback to snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Snapshot ID Number. |
required |
Source code in src/aimbat/cli/snapshot.py
station
View and manage stations.
Functions:
| Name | Description |
|---|---|
cli_station_delete |
Delete 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 the active event. |
cli_station_delete
cli_station_delete(
station_id: Annotated[UUID | str, Parameter(name=id)],
*,
global_parameters: GlobalParameters | None = None
) -> None
Delete existing station.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
station_id
|
Annotated[UUID | str, Parameter(name=id)]
|
Station ID. |
required |
Source code in src/aimbat/cli/station.py
cli_station_dump
cli_station_dump(
*, global_parameters: GlobalParameters | None = None
) -> None
Dump the contents of the AIMBAT station table to json.
Source code in src/aimbat/cli/station.py
cli_station_list
cli_station_list(
*,
all_events: Annotated[
bool, Parameter(name=all)
] = False,
table_parameters: TableParameters | None = None,
global_parameters: GlobalParameters | None = None
) -> None
Print information on the stations used in the active event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_events
|
Annotated[bool, Parameter(name=all)]
|
Select stations for all events. |
False
|
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.
Functions:
| Name | Description |
|---|---|
cli_checkdata |
Check if there are any problems with SAC files before adding them to a project. |
cli_checkdata
cli_checkdata(
sacfiles: Annotated[
list[Path],
Parameter(name=data, consume_multiple=True),
],
*,
common: GlobalParameters | None = None
) -> None
Check if there are any problems with SAC files before adding them to a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sacfiles
|
Annotated[list[Path], Parameter(name=data, consume_multiple=True)]
|
One or more SAC files. |
required |
Source code in src/aimbat/cli/utils/app.py
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(
*, global_parameters: GlobalParameters | None = None
) -> None
Recursively delete sample data directory.
Source code in src/aimbat/cli/utils/sampledata.py
sampledata_cli_download
sampledata_cli_download(
*,
force: bool = False,
global_parameters: GlobalParameters | None = None
) -> None
Download AIMBAT sample data.
Downloads an example dataset to the directory specified in the
sampledata_dir AIMBAT default variable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force
|
bool
|
Delete the download directory and re-download." |
False
|