Skip to content

aimbat.models

ORM classes mapping to AIMBAT database tables.

Each class in this module corresponds to a table in the SQLite project database and is built on SQLModel, which combines SQLAlchemy (for database access) with Pydantic (for validation).

The main classes and their relationships are:

  • AimbatEvent — a seismic event. Only one event can be active at a time, enforced by a database constraint on the active column.
  • AimbatStation — a seismic recording station.
  • AimbatSeismogram — links an AimbatEvent to an AimbatStation and holds the timing metadata (begin_time, delta, t0). Waveform data is accessed via the associated AimbatDataSource.
  • AimbatDataSource — records where the waveform data for a seismogram is stored, along with its type (e.g. SAC).
  • AimbatEventParameters — processing parameters shared across all seismograms of an event (window bounds, bandpass filter settings, MCCC settings, etc.).
  • AimbatSeismogramParameters — per-seismogram processing parameters (flip, select, working pick t1).
  • AimbatSnapshot — captures a point-in-time copy of event and seismogram parameters via AimbatEventParametersSnapshot and AimbatSeismogramParametersSnapshot, enabling rollback and comparison.

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.

AimbatEvent

Class to store seismic event information.

AimbatEventParameters

Processing parameters common to all seismograms of a particular event.

AimbatEventParametersSnapshot

Snapshot of processing parameters for a particular event.

AimbatSeismogram

Class to store seismogram metadata.

AimbatSeismogramParameters

Processing parameters for a single seismogram.

AimbatSeismogramParametersSnapshot

Snapshot of processing parameters for a single seismogram.

AimbatSnapshot

Container for a point-in-time snapshot of event and seismogram parameters.

AimbatStation

Class to store station information.

AimbatDataSource

Bases: SQLModel

Class to store data source information.

Parameters:

Name Type Description Default
id UUID

Unique ID.

UUID('fe3d84f6-7ccb-4f04-bcc2-d1d44aa07d28')
sourcename str

Path or name of the data source.

required
datatype DataType

Data type of the data source.

required
seismogram_id UUID

Foreign key referencing the parent seismogram.

None

Attributes:

Name Type Description
seismogram AimbatSeismogram

The seismogram this data source belongs to.

Source code in src/aimbat/models/_models.py
class AimbatDataSource(SQLModel, table=True):
    """Class to store data source information."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    sourcename: str = Field(description="Path or name of the data source.")
    datatype: DataType = Field(description="Data type of the data source.")
    seismogram_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatseismogram.id",
        ondelete="CASCADE",
        description="Foreign key referencing the parent seismogram.",
    )
    seismogram: "AimbatSeismogram" = Relationship(back_populates="datasource")
    "The seismogram this data source belongs to."

seismogram class-attribute instance-attribute

seismogram: AimbatSeismogram = Relationship(
    back_populates="datasource"
)

The seismogram this data source belongs to.

AimbatEvent

Bases: SQLModel

Class to store seismic event information.

Parameters:

Name Type Description Default
id UUID

Unique ID.

UUID('ed6ffbf6-6f3f-4c3b-94da-583fc123f5cf')
active bool | None

Indicates if an event is the active event.

None
time PydanticTimestamp

Event time.

required
latitude float

Event latitude.

required
longitude float

Event longitude.

required
depth float | None

Event depth.

None

Attributes:

Name Type Description
parameters AimbatEventParameters

Event parameters.

seismograms list[AimbatSeismogram]

List of seismograms of this event.

snapshots list[AimbatSnapshot]

List of snapshots.

Source code in src/aimbat/models/_models.py
class AimbatEvent(SQLModel, table=True):
    """Class to store seismic event information."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )

    active: bool | None = Field(
        default=None,
        unique=True,
        description="Indicates if an event is the active event.",
    )

    time: PydanticTimestamp = Field(
        unique=True,
        sa_type=SAPandasTimestamp,
        allow_mutation=False,
        description="Event time.",
    )

    latitude: float = Field(description="Event latitude.")
    longitude: float = Field(description="Event longitude.")
    depth: float | None = Field(default=None, description="Event depth.")
    seismograms: list[AimbatSeismogram] = Relationship(
        back_populates="event", cascade_delete=True
    )
    "List of seismograms of this event."

    parameters: AimbatEventParameters = Relationship(
        back_populates="event", cascade_delete=True
    )
    "Event parameters."

    snapshots: list[AimbatSnapshot] = Relationship(
        back_populates="event", cascade_delete=True
    )
    "List of snapshots."

    if TYPE_CHECKING:
        seismogram_count: int = 0
        station_count: int = 0

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

Processing parameters common to all seismograms of a particular event.

Parameters:

Name Type Description Default
completed bool

Mark an event as completed.

False
min_ccnorm float

Minimum cross-correlation used when automatically de-selecting seismograms.

0.5
window_pre PydanticNegativeTimedelta

Pre-pick window length.

Timedelta('-1 days +23:59:45')
window_post PydanticPositiveTimedelta

Post-pick window length.

Timedelta('0 days 00:00:15')
bandpass_apply bool

Whether to apply bandpass filter to seismograms.

False
bandpass_fmin float

Minimum frequency for bandpass filter (ignored if bandpass_apply is False).

0.05
bandpass_fmax float

Maximum frequency for bandpass filter (ignored if bandpass_apply is False).

2.0
mccc_damp float

Damping factor for MCCC algorithm.

0.1
mccc_min_ccnorm float

Minimum correlation coefficient required to include a pair in the MCCC inversion.

0.5
id UUID

Unique ID.

UUID('5ac4a252-7ea7-4398-9228-a7da307d94d5')
event_id UUID

Foreign key referencing the parent event.

None

Methods:

Name Description
check_freq_range

Validate that bandpass_fmax is strictly greater than bandpass_fmin.

Attributes:

Name Type Description
event AimbatEvent

The event these parameters belong to.

snapshots list[AimbatEventParametersSnapshot]

Parameter snapshots for this event.

Source code in src/aimbat/models/_models.py
class AimbatEventParameters(AimbatEventParametersBase, table=True):
    """Processing parameters common to all seismograms of a particular event."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    event_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatevent.id",
        ondelete="CASCADE",
        description="Foreign key referencing the parent event.",
    )
    event: "AimbatEvent" = Relationship(back_populates="parameters")
    "The event these parameters belong to."
    snapshots: list["AimbatEventParametersSnapshot"] = Relationship(
        back_populates="parameters", cascade_delete=True
    )
    "Parameter snapshots for this event."

event class-attribute instance-attribute

event: AimbatEvent = Relationship(
    back_populates="parameters"
)

The event these parameters belong to.

snapshots class-attribute instance-attribute

snapshots: list[AimbatEventParametersSnapshot] = (
    Relationship(
        back_populates="parameters", cascade_delete=True
    )
)

Parameter snapshots for this event.

check_freq_range

check_freq_range() -> Self

Validate that bandpass_fmax is strictly greater than bandpass_fmin.

Source code in src/aimbat/models/_parameters.py
@model_validator(mode="after")
def check_freq_range(self) -> Self:
    """Validate that `bandpass_fmax` is strictly greater than `bandpass_fmin`."""
    if self.bandpass_fmax <= self.bandpass_fmin:
        raise ValueError("bandpass_fmax must be > bandpass_fmin")
    return self

AimbatEventParametersSnapshot

Bases: AimbatEventParametersBase

Snapshot of processing parameters for a particular event.

Parameters:

Name Type Description Default
completed bool

Mark an event as completed.

False
min_ccnorm float

Minimum cross-correlation used when automatically de-selecting seismograms.

0.5
window_pre PydanticNegativeTimedelta

Pre-pick window length.

Timedelta('-1 days +23:59:45')
window_post PydanticPositiveTimedelta

Post-pick window length.

Timedelta('0 days 00:00:15')
bandpass_apply bool

Whether to apply bandpass filter to seismograms.

False
bandpass_fmin float

Minimum frequency for bandpass filter (ignored if bandpass_apply is False).

0.05
bandpass_fmax float

Maximum frequency for bandpass filter (ignored if bandpass_apply is False).

2.0
mccc_damp float

Damping factor for MCCC algorithm.

0.1
mccc_min_ccnorm float

Minimum correlation coefficient required to include a pair in the MCCC inversion.

0.5
id UUID

Unique ID.

UUID('601667ff-9881-4d17-bca6-226bde44fd1b')
snapshot_id UUID

Foreign key referencing the parent snapshot.

None
parameters_id UUID

Foreign key referencing the source event parameters.

None

Methods:

Name Description
check_freq_range

Validate that bandpass_fmax is strictly greater than bandpass_fmin.

Attributes:

Name Type Description
parameters AimbatEventParameters

The event parameters this snapshot was taken from.

snapshot AimbatSnapshot

The snapshot this record belongs to.

Source code in src/aimbat/models/_models.py
class AimbatEventParametersSnapshot(AimbatEventParametersBase, table=True):
    """Snapshot of processing parameters for a particular event."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    snapshot_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatsnapshot.id",
        ondelete="CASCADE",
        description="Foreign key referencing the parent snapshot.",
    )
    snapshot: "AimbatSnapshot" = Relationship(
        back_populates="event_parameters_snapshot"
    )
    "The snapshot this record belongs to."
    parameters: AimbatEventParameters = Relationship(back_populates="snapshots")
    "The event parameters this snapshot was taken from."
    parameters_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbateventparameters.id",
        ondelete="CASCADE",
        description="Foreign key referencing the source event parameters.",
    )

parameters class-attribute instance-attribute

parameters: AimbatEventParameters = Relationship(
    back_populates="snapshots"
)

The event parameters this snapshot was taken from.

snapshot class-attribute instance-attribute

snapshot: AimbatSnapshot = Relationship(
    back_populates="event_parameters_snapshot"
)

The snapshot this record belongs to.

check_freq_range

check_freq_range() -> Self

Validate that bandpass_fmax is strictly greater than bandpass_fmin.

Source code in src/aimbat/models/_parameters.py
@model_validator(mode="after")
def check_freq_range(self) -> Self:
    """Validate that `bandpass_fmax` is strictly greater than `bandpass_fmin`."""
    if self.bandpass_fmax <= self.bandpass_fmin:
        raise ValueError("bandpass_fmax must be > bandpass_fmin")
    return self

AimbatSeismogram

Bases: SQLModel

Class to store seismogram metadata.

Parameters:

Name Type Description Default
id UUID

Unique ID.

UUID('877968d5-a9d7-4867-a091-fab483493457')
begin_time PydanticTimestamp

Start time of the seismogram.

required
delta PydanticPositiveTimedelta

Sampling interval.

required
t0 PydanticTimestamp

Initial phase arrival pick.

required
station_id UUID

Foreign key referencing the recording station.

None
event_id UUID

Foreign key referencing the parent event.

None

Methods:

Name Description
end_time

End time of the seismogram, derived from begin_time, delta, and data length.

Attributes:

Name Type Description
data NDArray[float64]

Seismogram waveform data array.

datasource AimbatDataSource

Data source for the seismogram waveform.

event AimbatEvent

The event this seismogram belongs to.

flip bool

Whether the seismogram should be flipped.

parameters AimbatSeismogramParameters

Processing parameters for this seismogram.

select bool

Whether this seismogram should be used for processing.

station AimbatStation

The station that recorded this seismogram.

t1 Timestamp | None

Working phase arrival pick.

Source code in src/aimbat/models/_models.py
class AimbatSeismogram(SQLModel, table=True):
    """Class to store seismogram metadata."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    begin_time: PydanticTimestamp = Field(
        sa_type=SAPandasTimestamp, description="Start time of the seismogram."
    )
    delta: PydanticPositiveTimedelta = Field(
        sa_type=SAPandasTimedelta, description="Sampling interval."
    )
    t0: PydanticTimestamp = Field(
        sa_type=SAPandasTimestamp, description="Initial phase arrival pick."
    )
    datasource: AimbatDataSource = Relationship(
        back_populates="seismogram", cascade_delete=True
    )
    "Data source for the seismogram waveform."
    station_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatstation.id",
        ondelete="CASCADE",
        description="Foreign key referencing the recording station.",
    )
    station: "AimbatStation" = Relationship(back_populates="seismograms")
    "The station that recorded this seismogram."
    event_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatevent.id",
        ondelete="CASCADE",
        description="Foreign key referencing the parent event.",
    )
    event: "AimbatEvent" = Relationship(back_populates="seismograms")
    "The event this seismogram belongs to."
    parameters: "AimbatSeismogramParameters" = Relationship(
        back_populates="seismogram",
        cascade_delete=True,
    )
    "Processing parameters for this seismogram."

    if TYPE_CHECKING:
        # Add same default values for type checking purposes
        # as in AimbatSeismogramParametersBase
        flip: bool = False
        select: bool = True
        t1: Timestamp | None = None
        data: npt.NDArray[np.float64] = np.array([])

        @property
        def end_time(self) -> Timestamp: ...

    else:

        @computed_field
        def end_time(self) -> PydanticTimestamp:
            """End time of the seismogram, derived from begin_time, delta, and data length."""
            if len(self.data) == 0:
                return self.begin_time
            return self.begin_time + self.delta * (len(self.data) - 1)

        @property
        def flip(self) -> bool:
            """Whether the seismogram should be flipped."""
            return self.parameters.flip

        @flip.setter
        def flip(self, value: bool) -> None:
            self.parameters.flip = value

        @property
        def select(self) -> bool:
            """Whether this seismogram should be used for processing."""
            return self.parameters.select

        @select.setter
        def select(self, value: bool) -> None:
            self.parameters.select = value

        @property
        def t1(self) -> Timestamp | None:
            """Working phase arrival pick."""
            return self.parameters.t1

        @t1.setter
        def t1(self, value: Timestamp | None) -> None:
            self.parameters.t1 = value

        @property
        def data(self) -> npt.NDArray[np.float64]:
            """Seismogram waveform data array."""
            if self.datasource is None:
                raise ValueError("Expected a valid datasource name, got None.")
            return read_seismogram_data(
                self.datasource.sourcename, self.datasource.datatype
            )

        @data.setter
        def data(self, value: npt.NDArray[np.float64]) -> None:
            if self.datasource is None:
                raise ValueError("Expected a valid datasource name, got None.")
            write_seismogram_data(
                self.datasource.sourcename, self.datasource.datatype, value
            )

data property writable

Seismogram waveform data array.

datasource class-attribute instance-attribute

datasource: AimbatDataSource = Relationship(
    back_populates="seismogram", cascade_delete=True
)

Data source for the seismogram waveform.

event class-attribute instance-attribute

event: AimbatEvent = Relationship(
    back_populates="seismograms"
)

The event this seismogram belongs to.

flip property writable

flip: bool

Whether the seismogram should be flipped.

parameters class-attribute instance-attribute

parameters: AimbatSeismogramParameters = Relationship(
    back_populates="seismogram", cascade_delete=True
)

Processing parameters for this seismogram.

select property writable

select: bool

Whether this seismogram should be used for processing.

station class-attribute instance-attribute

station: AimbatStation = Relationship(
    back_populates="seismograms"
)

The station that recorded this seismogram.

t1 property writable

t1: Timestamp | None

Working phase arrival pick.

end_time

end_time() -> PydanticTimestamp

End time of the seismogram, derived from begin_time, delta, and data length.

Source code in src/aimbat/models/_models.py
@computed_field
def end_time(self) -> PydanticTimestamp:
    """End time of the seismogram, derived from begin_time, delta, and data length."""
    if len(self.data) == 0:
        return self.begin_time
    return self.begin_time + self.delta * (len(self.data) - 1)

AimbatSeismogramParameters

Bases: AimbatSeismogramParametersBase

Processing parameters for a single seismogram.

Parameters:

Name Type Description Default
flip bool

Whether or not the seismogram should be flipped.

False
select bool

Whether or not this seismogram should be used for processing.

True
t1 PydanticTimestamp | None

Working pick. This pick serves as working as well as output pick. It is changed by: 1. Picking the phase arrival in the stack, 2. Running ICCS, 3. Running MCCC.

None
id UUID

Unique ID.

UUID('637ea462-56df-4f88-bff3-51f4365e2e8d')
seismogram_id UUID

Foreign key referencing the parent seismogram.

None

Attributes:

Name Type Description
seismogram AimbatSeismogram

The seismogram these parameters belong to.

snapshots list[AimbatSeismogramParametersSnapshot]

Parameter snapshots for this seismogram.

Source code in src/aimbat/models/_models.py
class AimbatSeismogramParameters(AimbatSeismogramParametersBase, table=True):
    """Processing parameters for a single seismogram."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    seismogram_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatseismogram.id",
        ondelete="CASCADE",
        description="Foreign key referencing the parent seismogram.",
    )
    seismogram: "AimbatSeismogram" = Relationship(back_populates="parameters")
    "The seismogram these parameters belong to."
    snapshots: list["AimbatSeismogramParametersSnapshot"] = Relationship(
        back_populates="parameters", cascade_delete=True
    )
    "Parameter snapshots for this seismogram."

seismogram class-attribute instance-attribute

seismogram: AimbatSeismogram = Relationship(
    back_populates="parameters"
)

The seismogram these parameters belong to.

snapshots class-attribute instance-attribute

snapshots: list[AimbatSeismogramParametersSnapshot] = (
    Relationship(
        back_populates="parameters", cascade_delete=True
    )
)

Parameter snapshots for this seismogram.

AimbatSeismogramParametersSnapshot

Bases: AimbatSeismogramParametersBase

Snapshot of processing parameters for a single seismogram.

Parameters:

Name Type Description Default
flip bool

Whether or not the seismogram should be flipped.

False
select bool

Whether or not this seismogram should be used for processing.

True
t1 PydanticTimestamp | None

Working pick. This pick serves as working as well as output pick. It is changed by: 1. Picking the phase arrival in the stack, 2. Running ICCS, 3. Running MCCC.

None
id UUID

Unique ID.

UUID('cec483a6-a63b-4674-bf78-a5f91e9cdb27')
seismogram_parameters_id UUID

Foreign key referencing the source seismogram parameters.

required
snapshot_id UUID

Foreign key referencing the parent snapshot.

None

Attributes:

Name Type Description
parameters AimbatSeismogramParameters

The seismogram parameters this snapshot was taken from.

snapshot AimbatSnapshot

The snapshot this record belongs to.

Source code in src/aimbat/models/_models.py
class AimbatSeismogramParametersSnapshot(AimbatSeismogramParametersBase, table=True):
    """Snapshot of processing parameters for a single seismogram."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    seismogram_parameters_id: uuid.UUID = Field(
        foreign_key="aimbatseismogramparameters.id",
        ondelete="CASCADE",
        description="Foreign key referencing the source seismogram parameters.",
    )
    parameters: AimbatSeismogramParameters = Relationship(back_populates="snapshots")
    "The seismogram parameters this snapshot was taken from."
    snapshot_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatsnapshot.id",
        ondelete="CASCADE",
        description="Foreign key referencing the parent snapshot.",
    )
    snapshot: "AimbatSnapshot" = Relationship(
        back_populates="seismogram_parameters_snapshots"
    )
    "The snapshot this record belongs to."

parameters class-attribute instance-attribute

parameters: AimbatSeismogramParameters = Relationship(
    back_populates="snapshots"
)

The seismogram parameters this snapshot was taken from.

snapshot class-attribute instance-attribute

snapshot: AimbatSnapshot = Relationship(
    back_populates="seismogram_parameters_snapshots"
)

The snapshot this record belongs to.

AimbatSnapshot

Bases: SQLModel

Container for a point-in-time snapshot of event and seismogram parameters.

The AimbatSnapshot class does not actually save any parameter data. It is used to keep track of the AimbatEventParametersSnapshot and AimbatSeismogramParametersSnapshot instances.

Parameters:

Name Type Description Default
id UUID

Unique ID.

UUID('0b16ab05-8a6f-45bc-a68d-d3bc6bab4cf5')
date PydanticTimestamp

Timestamp when the snapshot was created.

Timestamp('2026-02-27 16:10:09.020614+0000', tz='UTC')
comment str | None

Optional comment for the snapshot.

None
event_id UUID

Foreign key referencing the parent event.

None

Attributes:

Name Type Description
event AimbatEvent

The event this snapshot belongs to.

event_parameters_snapshot AimbatEventParametersSnapshot

Event parameter snapshot associated with this snapshot.

seismogram_parameters_snapshots list[AimbatSeismogramParametersSnapshot]

Seismogram parameter snapshots associated with this snapshot.

Source code in src/aimbat/models/_models.py
class AimbatSnapshot(SQLModel, table=True):
    """Container for a point-in-time snapshot of event and seismogram parameters.

    The AimbatSnapshot class does not actually save any parameter data.
    It is used to keep track of the AimbatEventParametersSnapshot and
    AimbatSeismogramParametersSnapshot instances.
    """

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    date: PydanticTimestamp = Field(
        default_factory=lambda: Timestamp.now(tz=timezone.utc),
        unique=True,
        allow_mutation=False,
        sa_type=SAPandasTimestamp,
        description="Timestamp when the snapshot was created.",
    )
    comment: str | None = Field(
        default=None, description="Optional comment for the snapshot."
    )
    event_parameters_snapshot: AimbatEventParametersSnapshot = Relationship(
        back_populates="snapshot", cascade_delete=True
    )
    "Event parameter snapshot associated with this snapshot."
    seismogram_parameters_snapshots: list[AimbatSeismogramParametersSnapshot] = (
        Relationship(back_populates="snapshot", cascade_delete=True)
    )
    "Seismogram parameter snapshots associated with this snapshot."
    event_id: uuid.UUID = Field(
        default=None,
        foreign_key="aimbatevent.id",
        ondelete="CASCADE",
        description="Foreign key referencing the parent event.",
    )
    event: "AimbatEvent" = Relationship(back_populates="snapshots")
    "The event this snapshot belongs to."

event class-attribute instance-attribute

event: AimbatEvent = Relationship(
    back_populates="snapshots"
)

The event this snapshot belongs to.

event_parameters_snapshot class-attribute instance-attribute

event_parameters_snapshot: AimbatEventParametersSnapshot = (
    Relationship(
        back_populates="snapshot", cascade_delete=True
    )
)

Event parameter snapshot associated with this snapshot.

seismogram_parameters_snapshots class-attribute instance-attribute

seismogram_parameters_snapshots: list[
    AimbatSeismogramParametersSnapshot
] = Relationship(
    back_populates="snapshot", cascade_delete=True
)

Seismogram parameter snapshots associated with this snapshot.

AimbatStation

Bases: SQLModel

Class to store station information.

Parameters:

Name Type Description Default
id UUID

Unique ID.

UUID('5c208a0b-a01f-4ffd-be78-08f3251d83d8')
name str

Station name.

required
network str

Network name.

required
location str

Location ID.

required
channel str

Channel code.

required
latitude float

Station latitude.

required
longitude float

Station longitude.

required
elevation float | None

Station elevation.

None

Attributes:

Name Type Description
seismograms list[AimbatSeismogram]

Seismograms recorded at this station.

Source code in src/aimbat/models/_models.py
class AimbatStation(SQLModel, table=True):
    """Class to store station information."""

    id: uuid.UUID = Field(
        default_factory=uuid.uuid4, primary_key=True, description="Unique ID."
    )
    name: str = Field(allow_mutation=False, description="Station name.")
    network: str = Field(allow_mutation=False, description="Network name.")
    location: str = Field(allow_mutation=False, description="Location ID.")
    channel: str = Field(allow_mutation=False, description="Channel code.")
    latitude: float = Field(description="Station latitude.")
    longitude: float = Field(description="Station longitude.")
    elevation: float | None = Field(default=None, description="Station elevation.")
    seismograms: list[AimbatSeismogram] = Relationship(
        back_populates="station", cascade_delete=True
    )
    "Seismograms recorded at this station."

seismograms class-attribute instance-attribute

seismograms: list[AimbatSeismogram] = Relationship(
    back_populates="station", cascade_delete=True
)

Seismograms recorded at this station.