Event¶
-
class
mss_dataserver.event.core.
Event
(start_time, end_time, db_id=None, public_id=None, event_type=None, event_type_certainty=None, description=None, comment=None, tags=[], agency_uri=None, author_uri=None, creation_time=None, parent=None, changed=True, detections=None)[source]¶ Bases:
object
A seismic event.
- Parameters
start_time (str or
obspy.UTCDateTime
) – The start time of the event. A string that can be parsed byobspy.UTCDateTime
or aobspy.UTCDateTime
instance.end_time (str or
obspy.UTCDateTime
) – The end time of the event. A string that can be parsed byobspy.UTCDateTime
or aobspy.UTCDateTime
instance.db_id (int) – The database id of the event.
public_id (str) – The public id of the event.
event_type (str) – The type of the event.
event_type_certainty (str) – The certainty of the event type.
description (str) – The description of the event.
comment (str) – The comment to the event.
tags (list of str) – The tags of the event.
agency_uri (str) – The Uniform Resource Identifier of the author agency.
author_uri (str) – The Uniform Resource Identifier of the author.
creation_time (str or
obspy.UTCDateTime
) – The creation time of the event. A string that can be parsed byobspy.UTCDateTime
or aobspy.UTCDateTime
instance.parent (object) – The parent object containing the event.
changed (bool) – Flag indicating if one of the event attributes has changes.
detection (list of
mss_dataserver.detection.Detection
) – The detections associated to the event.
- Variables
detection_state (str) – The state of the event detection [new, updated, closed].
pgv_stream (
obspy.Stream
) – The PGV stream of the event.detection_data (dict) – A dictionary holding the detection data related to the event. The detection data is created during the detection process using
mss_dataserver.event.delaunay_detection.DelaunayDetector
.
Properties¶
end_time_string
str: The string representation of the end time.
length
float: The length of the event in seconds.
max_pgv
float: The maximum PGV of all detections.
public_id
str: The public ID of the event.
rid
str: The resource ID of the event.
start_time_string
str: The string representation of the start time.
triggered_stations
list of tuple of str: The nsl codes of the stations that contributed to a detection.
Methods¶
|
Instance initialization |
|
Add a detection to the event. |
|
Set the channels according to the rec_stream_ids. |
|
Convert a database orm mapper event to a event. |
|
Get an orm representation to use it for bulk insertion into the database. |
|
Get a detection with the provided stations. |
Compute the detection start and end times for each station. |
|
Compute the maximum PGV of the individual stations that have |
|
|
Check if a detection is available for a set of stations. |
|
Check if a detection has been triggered at a station. |
|
Write the event to the database. |