aimbat.models
Models used in AIMBAT.
Type Aliases:
| Name | Description |
|---|---|
AimbatTypes |
Union of all AIMBAT models that exist in the database. |
Classes:
| Name | Description |
|---|---|
AimbatDataSource |
Class to store data source information. |
AimbatDataSourceCreate |
Class to store data source information. |
AimbatEvent |
Store event information. |
AimbatEventParameters |
Processing parameters common to all seismograms of a particular event. |
AimbatEventParametersBase |
Base class that defines the event parameters used in AIMBAT. |
AimbatEventParametersSnapshot |
Event parameter snapshot. |
AimbatEventRead |
Read model for AimbatEvent including computed counts. |
AimbatSeismogram |
Class to store seismogram data |
AimbatSeismogramParameters |
Class to store ICCS processing parameters of a single seismogram. |
AimbatSeismogramParametersBase |
Base class that defines the seismogram parameters used in AIMBAT. |
AimbatSeismogramParametersSnapshot |
Class to store a snapshot of ICCS processing parameters of a single seismogram. |
AimbatSnapshot |
Class to store AIMBAT snapshots. |
AimbatSnapshotRead |
Read model for AimbatSnapshot with a seismogram count. |
AimbatStation |
Class to store station information. |
AimbatTypes
AimbatTypes = (
AimbatDataSource
| AimbatStation
| AimbatEvent
| AimbatEventParameters
| AimbatSeismogram
| AimbatSeismogramParameters
| AimbatSnapshot
| AimbatEventParametersSnapshot
| AimbatSeismogramParametersSnapshot
)
Union of all AIMBAT models that exist in the database.
AimbatDataSource
Bases: SQLModel
Class to store data source information.
Source code in src/aimbat/models/_models.py
AimbatDataSourceCreate
AimbatEvent
Bases: SQLModel
Store event information.
Attributes:
| Name | Type | Description |
|---|---|---|
active |
bool | None
|
Indicates if an event is the active event. |
depth |
float | None
|
Event depth. |
id |
UUID
|
Unique ID. |
latitude |
float
|
Event latitude. |
longitude |
float
|
Event longitude. |
parameters |
AimbatEventParameters
|
Event parameters. |
seismograms |
list[AimbatSeismogram]
|
List of seismograms of this event. |
snapshots |
list[AimbatSnapshot]
|
List of snapshots. |
time |
PydanticTimestamp
|
Event time. |
Source code in src/aimbat/models/_models.py
active
class-attribute
instance-attribute
active: bool | None = Field(default=None, unique=True)
Indicates if an event is the active event.
id
class-attribute
instance-attribute
Unique ID.
parameters
class-attribute
instance-attribute
parameters: AimbatEventParameters = Relationship(
back_populates="event", cascade_delete=True
)
Event parameters.
seismograms
class-attribute
instance-attribute
seismograms: list[AimbatSeismogram] = Relationship(
back_populates="event", cascade_delete=True
)
List of seismograms of this event.
snapshots
class-attribute
instance-attribute
snapshots: list[AimbatSnapshot] = Relationship(
back_populates="event", cascade_delete=True
)
List of snapshots.
AimbatEventParameters
Bases: AimbatEventParametersBase, EventParametersValidatorMixin
Processing parameters common to all seismograms of a particular event.
Attributes:
| Name | Type | Description |
|---|---|---|
bandpass_apply |
bool
|
Whether to apply bandpass filter to seismograms. |
bandpass_fmax |
float
|
Maximum frequency for bandpass filter (ignored if |
bandpass_fmin |
float
|
Minimum frequency for bandpass filter (ignored if |
completed |
bool
|
Mark an event as completed. |
event |
AimbatEvent
|
Event these parameters are associated with. |
event_id |
UUID
|
Event ID these parameters are associated with. |
id |
UUID
|
Unique ID. |
min_ccnorm |
float
|
Minimum cross-correlation used when automatically de-selecting seismograms. |
snapshots |
list[AimbatEventParametersSnapshot]
|
Snapshots these parameters are associated with. |
window_post |
PydanticPositiveTimedelta
|
Post-pick window length. |
window_pre |
PydanticNegativeTimedelta
|
Pre-pick window length. |
Source code in src/aimbat/models/_models.py
bandpass_apply
class-attribute
instance-attribute
bandpass_apply: bool = Field(
default_factory=lambda: bandpass_apply
)
Whether to apply bandpass filter to seismograms.
bandpass_fmax
class-attribute
instance-attribute
bandpass_fmax: float = Field(
default_factory=lambda: bandpass_fmax, gt=0
)
Maximum frequency for bandpass filter (ignored if bandpass_apply is False).
bandpass_fmin
class-attribute
instance-attribute
bandpass_fmin: float = Field(
default_factory=lambda: bandpass_fmin, ge=0
)
Minimum frequency for bandpass filter (ignored if bandpass_apply is False).
event
class-attribute
instance-attribute
event: AimbatEvent = Relationship(
back_populates="parameters"
)
Event these parameters are associated with.
event_id
class-attribute
instance-attribute
event_id: UUID = Field(
default=None,
foreign_key="aimbatevent.id",
ondelete="CASCADE",
)
Event ID these parameters are associated with.
id
class-attribute
instance-attribute
Unique ID.
min_ccnorm
class-attribute
instance-attribute
min_ccnorm: float = Field(
ge=0.0, le=1.0, default_factory=lambda: min_ccnorm
)
Minimum cross-correlation used when automatically de-selecting seismograms.
snapshots
class-attribute
instance-attribute
snapshots: list[AimbatEventParametersSnapshot] = (
Relationship(
back_populates="parameters", cascade_delete=True
)
)
Snapshots these parameters are associated with.
AimbatEventParametersBase
Bases: SQLModel
Base class that defines the event parameters used in AIMBAT.
This class serves as a base that is inherited by the actual classes that create the database tables. The attributes in this class correspond exactl to the AIMBAT event parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
bandpass_apply |
bool
|
Whether to apply bandpass filter to seismograms. |
bandpass_fmax |
float
|
Maximum frequency for bandpass filter (ignored if |
bandpass_fmin |
float
|
Minimum frequency for bandpass filter (ignored if |
completed |
bool
|
Mark an event as completed. |
min_ccnorm |
float
|
Minimum cross-correlation used when automatically de-selecting seismograms. |
window_post |
PydanticPositiveTimedelta
|
Post-pick window length. |
window_pre |
PydanticNegativeTimedelta
|
Pre-pick window length. |
Source code in src/aimbat/models/_models.py
bandpass_apply
class-attribute
instance-attribute
bandpass_apply: bool = Field(
default_factory=lambda: bandpass_apply
)
Whether to apply bandpass filter to seismograms.
bandpass_fmax
class-attribute
instance-attribute
bandpass_fmax: float = Field(
default_factory=lambda: bandpass_fmax, gt=0
)
Maximum frequency for bandpass filter (ignored if bandpass_apply is False).
bandpass_fmin
class-attribute
instance-attribute
bandpass_fmin: float = Field(
default_factory=lambda: bandpass_fmin, ge=0
)
Minimum frequency for bandpass filter (ignored if bandpass_apply is False).
min_ccnorm
class-attribute
instance-attribute
min_ccnorm: float = Field(
ge=0.0, le=1.0, default_factory=lambda: min_ccnorm
)
Minimum cross-correlation used when automatically de-selecting seismograms.
AimbatEventParametersSnapshot
Bases: AimbatEventParametersBase
Event parameter snapshot.
Attributes:
| Name | Type | Description |
|---|---|---|
bandpass_apply |
bool
|
Whether to apply bandpass filter to seismograms. |
bandpass_fmax |
float
|
Maximum frequency for bandpass filter (ignored if |
bandpass_fmin |
float
|
Minimum frequency for bandpass filter (ignored if |
completed |
bool
|
Mark an event as completed. |
min_ccnorm |
float
|
Minimum cross-correlation used when automatically de-selecting seismograms. |
window_post |
PydanticPositiveTimedelta
|
Post-pick window length. |
window_pre |
PydanticNegativeTimedelta
|
Pre-pick window length. |
Source code in src/aimbat/models/_models.py
bandpass_apply
class-attribute
instance-attribute
bandpass_apply: bool = Field(
default_factory=lambda: bandpass_apply
)
Whether to apply bandpass filter to seismograms.
bandpass_fmax
class-attribute
instance-attribute
bandpass_fmax: float = Field(
default_factory=lambda: bandpass_fmax, gt=0
)
Maximum frequency for bandpass filter (ignored if bandpass_apply is False).
bandpass_fmin
class-attribute
instance-attribute
bandpass_fmin: float = Field(
default_factory=lambda: bandpass_fmin, ge=0
)
Minimum frequency for bandpass filter (ignored if bandpass_apply is False).
min_ccnorm
class-attribute
instance-attribute
min_ccnorm: float = Field(
ge=0.0, le=1.0, default_factory=lambda: min_ccnorm
)
Minimum cross-correlation used when automatically de-selecting seismograms.
AimbatEventRead
Bases: SQLModel
Read model for AimbatEvent including computed counts.
Methods:
| Name | Description |
|---|---|
from_event |
Create an AimbatEventRead from an AimbatEvent ORM instance. |
Source code in src/aimbat/models/_models.py
from_event
classmethod
from_event(event: AimbatEvent) -> Self
Create an AimbatEventRead from an AimbatEvent ORM instance.
Source code in src/aimbat/models/_models.py
AimbatSeismogram
Bases: SQLModel
Class to store seismogram data
Attributes:
| Name | Type | Description |
|---|---|---|
begin_time |
PydanticTimestamp
|
Begin time of seismogram. |
delta |
PydanticPositiveTimedelta
|
Sampling interval. |
id |
UUID
|
Unique ID. |
t0 |
PydanticTimestamp
|
Initial pick. |
Source code in src/aimbat/models/_models.py
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 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
begin_time
class-attribute
instance-attribute
Begin time of seismogram.
delta
class-attribute
instance-attribute
Sampling interval.
id
class-attribute
instance-attribute
Unique ID.
AimbatSeismogramParameters
Bases: AimbatSeismogramParametersBase
Class to store ICCS processing parameters of a single seismogram.
Attributes:
| Name | Type | Description |
|---|---|---|
flip |
bool
|
Whether or not the seismogram should be flipped. |
select |
bool
|
Whether or not this seismogram should be used for processing. |
t1 |
PydanticTimestamp | None
|
Working pick. |
Source code in src/aimbat/models/_models.py
AimbatSeismogramParametersBase
Bases: SQLModel
Base class that defines the seismogram parameters used in AIMBAT.
Attributes:
| Name | Type | Description |
|---|---|---|
flip |
bool
|
Whether or not the seismogram should be flipped. |
select |
bool
|
Whether or not this seismogram should be used for processing. |
t1 |
PydanticTimestamp | None
|
Working pick. |
Source code in src/aimbat/models/_models.py
AimbatSeismogramParametersSnapshot
Bases: AimbatSeismogramParametersBase
Class to store a snapshot of ICCS processing parameters of a single seismogram.
Attributes:
| Name | Type | Description |
|---|---|---|
flip |
bool
|
Whether or not the seismogram should be flipped. |
select |
bool
|
Whether or not this seismogram should be used for processing. |
t1 |
PydanticTimestamp | None
|
Working pick. |
Source code in src/aimbat/models/_models.py
AimbatSnapshot
Bases: SQLModel
Class to store AIMBAT snapshots.
The AimbatSnapshot class does not actually save any parameter data. It is used to keep track of the AimbatEventParametersSnapshot and AimbatSeismogramParametersSnapshot instances.
Attributes:
| Name | Type | Description |
|---|---|---|
event |
AimbatEvent
|
Event this snapshot is associated with. |
event_id |
UUID
|
Event ID this snapshot is associated with. |
Source code in src/aimbat/models/_models.py
event
class-attribute
instance-attribute
event: AimbatEvent = Relationship(
back_populates="snapshots"
)
Event this snapshot is associated with.
event_id
class-attribute
instance-attribute
event_id: UUID = Field(
default=None,
foreign_key="aimbatevent.id",
ondelete="CASCADE",
)
Event ID this snapshot is associated with.
AimbatSnapshotRead
Bases: SQLModel
Read model for AimbatSnapshot with a seismogram count.
Methods:
| Name | Description |
|---|---|
from_snapshot |
Create an AimbatSnapshotRead from an AimbatSnapshot ORM instance. |
Source code in src/aimbat/models/_models.py
from_snapshot
classmethod
from_snapshot(snapshot: AimbatSnapshot) -> Self
Create an AimbatSnapshotRead from an AimbatSnapshot ORM instance.
Source code in src/aimbat/models/_models.py
AimbatStation
Bases: SQLModel
Class to store station information.
Attributes:
| Name | Type | Description |
|---|---|---|
channel |
str
|
Channel code. |
elevation |
float | None
|
Station elevation. |
id |
UUID
|
Unique ID. |
latitude |
float
|
Station latitude |
location |
str
|
Location ID. |
longitude |
float
|
Station longitude |
name |
str
|
Station name. |
network |
str
|
Network name. |
seismograms |
list[AimbatSeismogram]
|
Seismograms recorded at this station. |
Source code in src/aimbat/models/_models.py
id
class-attribute
instance-attribute
Unique ID.
location
class-attribute
instance-attribute
location: str = Field(allow_mutation=False)
Location ID.
seismograms
class-attribute
instance-attribute
seismograms: list[AimbatSeismogram] = Relationship(
back_populates="station", cascade_delete=True
)
Seismograms recorded at this station.