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
#
Attributes:
| Name | Type | Description |
|---|---|---|
debug |
bool
|
Run in debugging mode. |
use_qt |
bool
|
Use pyqtgraph instead of matplotlib for plots (where applicable). |
Source code in src/aimbat/cli/common.py
9 10 11 12 13 14 15 16 17 18 19 20 | |
TableParameters
dataclass
#
Attributes:
| Name | Type | Description |
|---|---|---|
short |
bool
|
Shorten UUIDs and format data. |
Source code in src/aimbat/cli/common.py
23 24 25 26 27 | |
simple_exception
#
simple_exception(func: F) -> F
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
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
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 |
|---|---|---|---|
|
Annotated[list[Path], Parameter(name=files, consume_multiple=True, validator=Path(exists=True))]
|
Seismogram files to be added. |
required |
|
DataType
|
Specify type of seismogram file. |
SAC
|
|
Annotated[bool, Parameter(name=progress)]
|
Display progress bar. |
True
|
Source code in src/aimbat/cli/data.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
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
90 91 92 93 94 95 96 97 98 99 | |
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 |
|---|---|---|---|
|
Annotated[bool, Parameter(name=all)]
|
Select data for all events. |
False
|
Source code in src/aimbat/cli/data.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Event ID number. |
required |
Source code in src/aimbat/cli/event.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Event ID. |
required |
Source code in src/aimbat/cli/event.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
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
178 179 180 181 182 183 184 185 186 187 | |
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
111 112 113 114 115 116 117 118 119 120 121 122 | |
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 |
|---|---|---|---|
|
EventParameter
|
Event parameter name. |
required |
Source code in src/aimbat/cli/event.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
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 |
|---|---|---|---|
|
EventParameter
|
Event parameter name. |
required |
|
timedelta | str
|
Event parameter value. |
required |
Source code in src/aimbat/cli/event.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
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
#
Attributes:
| Name | Type | Description |
|---|---|---|
all |
bool
|
Include all seismograms in the plot, even if not used in stack. |
context |
bool
|
Plot seismograms with extra context instead of the short tapered ones used for cross-correlation. |
Source code in src/aimbat/cli/iccs.py
12 13 14 15 16 17 18 | |
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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Add extra padding to the time window for plotting. |
required |
Source code in src/aimbat/cli/iccs.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
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
117 118 119 120 121 122 123 124 125 126 127 128 | |
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 |
|---|---|---|---|
|
bool
|
Whether to automatically flip seismograms (multiply data by -1). |
False
|
|
bool
|
Whether to automatically de-select seismograms. |
False
|
Source code in src/aimbat/cli/iccs.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
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
195 196 197 198 199 200 201 202 203 204 205 206 | |
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 |
|---|---|---|---|
|
Annotated[bool, Parameter(name=img)]
|
Use the seismogram image to update pick. |
False
|
Source code in src/aimbat/cli/iccs.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
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 |
|---|---|---|---|
|
Annotated[bool, Parameter(name=img)]
|
Use the seismogram image to pick the time window. |
False
|
Source code in src/aimbat/cli/iccs.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
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.
Source code in src/aimbat/cli/project.py
40 41 42 43 44 45 46 | |
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
49 50 51 52 53 54 55 | |
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
58 59 60 61 62 63 64 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Seismogram ID. |
required |
Source code in src/aimbat/cli/seismogram.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
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
173 174 175 176 177 178 179 180 181 182 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Seismogram ID number. |
required |
|
SeismogramParameter
|
Name of the seismogram parameter. |
required |
Source code in src/aimbat/cli/seismogram.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
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 |
|---|---|---|---|
|
Annotated[bool, Parameter(all)]
|
Select seismograms for all events. |
False
|
Source code in src/aimbat/cli/seismogram.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
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
185 186 187 188 189 190 191 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Seismogram ID number. |
required |
|
SeismogramParameter
|
Name of the seismogram parameter. |
required |
|
str
|
Value of the seismogram parameter. |
required |
Source code in src/aimbat/cli/seismogram.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Snapshot ID Number. |
required |
Source code in src/aimbat/cli/snapshot.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
cli_snapshot_create
#
cli_snapshot_create(
comment: str | None = None,
*,
global_parameters: GlobalParameters | None = None
) -> None
Create new snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | None
|
Create snapshot with optional comment. |
None
|
Source code in src/aimbat/cli/snapshot.py
57 58 59 60 61 62 63 64 65 66 67 68 69 | |
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 |
|---|---|---|---|
|
Annotated[bool, Parameter(all)]
|
Select snapshots for all events. |
False
|
Source code in src/aimbat/cli/snapshot.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Snapshot ID Number. |
required |
Source code in src/aimbat/cli/snapshot.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
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 |
|---|---|---|---|
|
Annotated[UUID | str, Parameter(name=id)]
|
Station ID. |
required |
Source code in src/aimbat/cli/station.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
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
78 79 80 81 82 83 84 85 86 87 | |
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 |
|---|---|---|---|
|
Annotated[bool, Parameter(name=all)]
|
Select stations for all events. |
False
|
Source code in src/aimbat/cli/station.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
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 |
|---|---|---|---|
|
Annotated[list[Path], Parameter(name=data, consume_multiple=True)]
|
One or more SAC files. |
required |
Source code in src/aimbat/cli/utils/app.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
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
50 51 52 53 54 55 56 | |
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 |
|---|---|---|---|
|
bool
|
Delete the download directory and re-download." |
False
|
Source code in src/aimbat/cli/utils/sampledata.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |