obsplus.events.schema module

Pydantic schema for ObsPlus event model.

ObsPlus Event Model is a superset of, and compatible with, ObsPy’s Event model.

class obsplus.events.schema.Amplitude(**data)[source]

Bases: _ModelWithResourceID

category: Literal['point', 'mean', 'duration', 'period', 'integral', 'other'] | None
comments: list[Comment]
creation_info: CreationInfo | None
evaluation_mode: Literal['manual', 'automatic'] | None
evaluation_status: Literal['preliminary', 'confirmed', 'reviewed', 'final', 'rejected'] | None
filter_id: ResourceIdentifier | None
generic_amplitude: float | None
generic_amplitude_errors: QuantityError | None
magnitude_hint: str | None
method_id: ResourceIdentifier | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

period: float | None
period_errors: QuantityError | None
pick_id: ResourceIdentifier | None
scaling_time: Annotated[UTCDateTime, PlainValidator(func=_to_datetime, json_schema_input_type=Any)] | None
scaling_time_errors: QuantityError | None
snr: float | None
time_window: TimeWindow | None
type: str | None
unit: Literal['m', 's', 'm/s', 'm/(s*s)', 'm*s', 'dimensionless', 'other'] | None
waveform_id: WaveformStreamID | None
class obsplus.events.schema.Arrival(**data)[source]

Bases: _ModelWithResourceID

azimuth: float | None
backazimuth_residual: float | None
backazimuth_weight: float | None
comments: list[Comment]
creation_info: CreationInfo | None
distance: float | None
earth_model_id: ResourceIdentifier | None
horizontal_slowness_residual: float | None
horizontal_slowness_weight: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

phase: str | None
pick_id: ResourceIdentifier | None
takeoff_angle: float | None
takeoff_angle_errors: QuantityError | None
time_correction: float | None
time_residual: float | None
time_weight: float | None
class obsplus.events.schema.Axis(**data)[source]

Bases: _ObsPyModel

azimuth: float | None
length: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

plunge: float | None
class obsplus.events.schema.Catalog(**data)[source]

Bases: _ModelWithResourceID

A collection of events.

comments: list[Comment] | None
creation_info: CreationInfo | None
description: str | None
events: list[Event]
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class obsplus.events.schema.Comment(**data)[source]

Bases: _ModelWithResourceID

creation_info: CreationInfo | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

text: str | None
class obsplus.events.schema.CompositeTime(**data)[source]

Bases: _ObsPyModel

Composite Time

day: int | None
day_errors: QuantityError | None
hour: int | None
hour_errors: QuantityError | None
minute: int | None
minute_errors: QuantityError | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

month: int | None
month_errors: QuantityError | None
second: float | None
second_errors: QuantityError | None
year: int | None
year_errors: QuantityError | None
class obsplus.events.schema.ConfidenceEllipsoid(**data)[source]

Bases: _ObsPyModel

Confidence Ellipsoid

major_axis_azimuth: float | None
major_axis_plunge: float | None
major_axis_rotation: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

semi_intermediate_axis_length: float | None
semi_major_axis_length: float | None
semi_minor_axis_length: float | None
class obsplus.events.schema.CreationInfo(**data)[source]

Bases: _ObsPyModel

Creation info

agency_id: str | None
agency_uri: ResourceIdentifier | None
author: str | None
author_uri: ResourceIdentifier | None
creation_time: Annotated[UTCDateTime, PlainValidator(func=_to_datetime, json_schema_input_type=Any)] | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

version: str | None
class obsplus.events.schema.DataUsed(**data)[source]

Bases: _ObsPyModel

Data Used

component_count: int | None
longest_period: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shortest_period: float | None
station_count: int | None
wave_type: Literal['P waves', 'body waves', 'surface waves', 'mantle waves', 'combined', 'unknown'] | None
class obsplus.events.schema.Event(**data)[source]

Bases: _ModelWithResourceID

amplitudes: list[Amplitude]
comments: list[Comment]
creation_info: CreationInfo | None
event_descriptions: list[EventDescription]
event_type: Literal['not existing', 'not reported', 'earthquake', 'anthropogenic event', 'collapse', 'cavity collapse', 'mine collapse', 'building collapse', 'explosion', 'accidental explosion', 'chemical explosion', 'controlled explosion', 'experimental explosion', 'industrial explosion', 'mining explosion', 'quarry blast', 'road cut', 'blasting levee', 'nuclear explosion', 'induced or triggered event', 'rock burst', 'reservoir loading', 'fluid injection', 'fluid extraction', 'crash', 'plane crash', 'train crash', 'boat crash', 'other event', 'atmospheric event', 'sonic boom', 'sonic blast', 'acoustic noise', 'thunder', 'avalanche', 'snow avalanche', 'debris avalanche', 'hydroacoustic event', 'ice quake', 'slide', 'landslide', 'rockslide', 'meteorite', 'volcanic eruption'] | None
event_type_certainty: Literal['known', 'suspected'] | None
focal_mechanisms: list[FocalMechanism]
magnitudes: list[Magnitude]
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

origins: list[Origin]
picks: list[Pick]
preferred_focal_mechanism_id: ResourceIdentifier | None
preferred_magnitude_id: ResourceIdentifier | None
preferred_origin_id: ResourceIdentifier | None
station_magnitudes: list[StationMagnitude]
to_obspy()[source]

Convert the catalog to obspy form

class obsplus.events.schema.EventDescription(**data)[source]

Bases: _ObsPyModel

Event Description

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

text: str | None
type: Literal['felt report', 'Flinn-Engdahl region', 'local time', 'tectonic summary', 'nearest cities', 'earthquake name', 'region name'] | None
class obsplus.events.schema.FocalMechanism(**data)[source]

Bases: _ModelWithResourceID

Focal Mechanism

azimuthal_gap: float | None
comments: list[Comment]
creation_info: CreationInfo | None
evaluation_mode: Literal['manual', 'automatic'] | None
evaluation_status: Literal['preliminary', 'confirmed', 'reviewed', 'final', 'rejected'] | None
method_id: ResourceIdentifier | None
misfit: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

moment_tensor: MomentTensor | None
nodal_planes: NodalPlanes | None
principal_axes: PrincipalAxes | None
station_distribution_ratio: float | None
station_polarity_count: int | None
triggering_origin_id: ResourceIdentifier | None
waveform_id: list[WaveformStreamID]
class obsplus.events.schema.Magnitude(**data)[source]

Bases: _ModelWithResourceID

azimuthal_gap: float | None
comments: list[Comment]
creation_info: CreationInfo | None
evaluation_mode: Literal['manual', 'automatic'] | None
evaluation_status: Literal['preliminary', 'confirmed', 'reviewed', 'final', 'rejected'] | None
mag: float | None
mag_errors: QuantityError | None
magnitude_type: str | None
method_id: ResourceIdentifier | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

origin_id: ResourceIdentifier | None
station_count: int | None
station_magnitude_contributions: list[StationMagnitudeContribution]
class obsplus.events.schema.MomentTensor(**data)[source]

Bases: _ModelWithResourceID

Moment Tensor

category: Literal['teleseismic', 'regional'] | None
clvd: float | None
creation_info: CreationInfo | None
data_used: list[DataUsed] | None
derived_origin_id: ResourceIdentifier | None
double_couple: float | None
filter_id: ResourceIdentifier | None
greens_function_id: float | None
inversion_type: Literal['general', 'zero trace', 'double couple'] | None
iso: float | None
method_id: ResourceIdentifier | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

moment_magnitude_id: ResourceIdentifier | None
scalar_moment: float | None
scalar_moment_errors: QuantityError | None
source_time_function: SourceTimeFunction | None
tensor: Tensor | None
variance: float | None
variance_reduction: float | None
class obsplus.events.schema.NodalPlane(**data)[source]

Bases: _ObsPyModel

Nodal Plane

dip: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

rake: float | None
strike: float | None
class obsplus.events.schema.NodalPlanes(**data)[source]

Bases: _ObsPyModel

Nodal Planes

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nodal_plane_1: NodalPlane | None
nodal_plane_2: NodalPlane | None
preferred_plane: int | None
class obsplus.events.schema.Origin(**data)[source]

Bases: _ModelWithResourceID

arrivals: list[Arrival]
comments: list[Comment]
composite_times: list[CompositeTime]
creation_info: CreationInfo | None
depth: float | None
depth_errors: QuantityError | None
depth_type: Literal['from location', 'from moment tensor inversion', 'from modeling of broad-band P waveforms', 'constrained by depth phases', 'constrained by direct phases', 'constrained by depth and direct phases', 'operator assigned', 'other'] | None
earth_model_id: ResourceIdentifier | None
epicenter_fixed: bool | None
evaluation_mode: Literal['manual', 'automatic'] | None
evaluation_status: Literal['preliminary', 'confirmed', 'reviewed', 'final', 'rejected'] | None
latitude: float | None
latitude_errors: QuantityError | None
longitude: float | None
longitude_errors: QuantityError | None
method_id: ResourceIdentifier | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

origin_type: Literal['hypocenter', 'centroid', 'amplitude', 'macroseismic', 'rupture start', 'rupture end'] | None
origin_uncertainty: OriginUncertainty | None
quality: OriginQuality | None
reference_system_id: ResourceIdentifier | None
region: str | None
time: Annotated[UTCDateTime, PlainValidator(func=_to_datetime, json_schema_input_type=Any)]
time_errors: QuantityError | None
time_fixed: bool | None
class obsplus.events.schema.OriginQuality(**data)[source]

Bases: _ObsPyModel

Origin Quality

associated_phase_count: int | None
associated_station_count: int | None
azimuthal_gap: float | None
depth_phase_count: int | None
ground_truth_level: str | None
maximum_distance: float | None
median_distance: float | None
minimum_distance: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

secondary_azimuthal_gap: float | None
standard_error: float | None
used_phase_count: int | None
used_station_count: int | None
class obsplus.events.schema.OriginUncertainty(**data)[source]

Bases: _ObsPyModel

Origin Uncertainty

azimuth_max_horizontal_uncertainty: float | None
confidence_ellipsoid: ConfidenceEllipsoid | None
confidence_level: float | None
horizontal_uncertainty: float | None
max_horizontal_uncertainty: float | None
min_horizontal_uncertainty: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

preferred_description: Literal['horizontal uncertainty', 'uncertainty ellipse', 'confidence ellipsoid'] | None
class obsplus.events.schema.Pick(**data)[source]

Bases: _ModelWithResourceID

backazimuth: float | None
backazimuth_errors: QuantityError | None
comments: list[Comment]
creation_info: CreationInfo | None
evaluation_mode: Literal['manual', 'automatic'] | None
evaluation_status: Literal['preliminary', 'confirmed', 'reviewed', 'final', 'rejected'] | None
filter_id: ResourceIdentifier | None
horizontal_slowness: float | None
horizontal_slowness_errors: QuantityError | None
method_id: ResourceIdentifier | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

onset: Literal['emergent', 'impulsive', 'questionable'] | None
phase_hint: str | None
polarity: Literal['positive', 'negative', 'undecidable'] | None
slowness_method_id: ResourceIdentifier | None
time: Annotated[UTCDateTime, PlainValidator(func=_to_datetime, json_schema_input_type=Any)] | None
time_errors: QuantityError | None
waveform_id: WaveformStreamID | None
class obsplus.events.schema.PrincipalAxes(**data)[source]

Bases: _ObsPyModel

Principal Axes

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

n_axis: Axis | None
p_axis: Axis | None
t_axis: Axis | None
class obsplus.events.schema.QuantityError(**data)[source]

Bases: _ObsPyModel

Quantity Error

confidence_level: float | None
lower_uncertainty: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

uncertainty: float | None
upper_uncertainty: float | None
class obsplus.events.schema.ResourceIdentifier(**data)[source]

Bases: _ObsPyModel

Resource ID

id: str
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class obsplus.events.schema.SourceTimeFunction(**data)[source]

Bases: _ObsPyModel

Source Time Function

decay_time: float | None
duration: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

rise_time: float | None
type: Literal['box car', 'triangle', 'trapezoid', 'unknown'] | None
class obsplus.events.schema.StationMagnitude(**data)[source]

Bases: _ModelWithResourceID

Station Magnitude.

amplitude_id: ResourceIdentifier | None
comments: list[Comment]
creation_info: CreationInfo | None
mag: float | None
mag_errors: QuantityError | None
method_id: ResourceIdentifier | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

origin_id: ResourceIdentifier | None
station_magnitude_type: str | None
waveform_id: WaveformStreamID | None
class obsplus.events.schema.StationMagnitudeContribution(**data)[source]

Bases: _ObsPyModel

Station Magnitude Contribution

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

residual: float | None
station_magnitude_id: ResourceIdentifier | None
weight: float | None
class obsplus.events.schema.Tensor(**data)[source]

Bases: _ObsPyModel

m_pp: float | None
m_pp_errors: QuantityError | None
m_rp: float | None
m_rp_errors: QuantityError | None
m_rr: float | None
m_rr_errors: QuantityError | None
m_rt: float | None
m_rt_errors: QuantityError | None
m_tp: float | None
m_tp_errors: QuantityError | None
m_tt: float | None
m_tt_errors: QuantityError | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class obsplus.events.schema.TimeWindow(**data)[source]

Bases: _ObsPyModel

Time Window

begin: float | None
end: float | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

reference: Annotated[UTCDateTime, PlainValidator(func=_to_datetime, json_schema_input_type=Any)] | None
class obsplus.events.schema.WaveformStreamID(**data)[source]

Bases: _ObsPyModel

Waveform stream ID

channel_code: str | None
location_code: str | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

network_code: str | None
classmethod parse_seed_id(values)[source]

Parse seed IDs if needed.

resource_uri: ResourceIdentifier | None
seed_string: str | None
station_code: str | None