pyrocko.io.quakeml
¶
QuakeML 1.2 input, output, and data model.
This modules provides support to read and write QuakeML version 1.2. It defines a hierarchy of Python objects, closely following the QuakeML data model.
QuakeML is a flexible, extensible and modular XML representation of seismological data which is intended to cover a broad range of fields of application in modern seismology. It covers basic seismic event description, including moment tensors.
For convenience and ease of use, this documentation contains excerpts from the QuakeML Manual. However, this information is not intended to be complete. Please refer to the QuakeML Manual for details.
-
class
ResourceIdentifier
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringPattern
Identifies resource origin.
They consist of an authority identifier, a unique resource identifier, and an optional local identifier. The URI schema name smi stands for seismological meta-information, thus indicating a connection to a set of metadata associated with the resource.
-
class
WhitespaceOrEmptyStringType
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringPattern
Any
str
matching pattern'^\\s*$'
.
-
class
OriginUncertaintyDescription
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Preferred uncertainty description.
-
class
AmplitudeCategory
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Description of the way the waveform trace is evaluated to get an amplitude value.
This can be just reading a single value for a given point in time (point), taking a mean value over a time interval (mean), integrating the trace over a time interval (integral), specifying just a time interval (duration), or evaluating a period (period).
-
class
OriginDepthType
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Type of depth determination.
-
class
MTInversionType
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Type of moment tensor inversion.
Users should avoid to give contradictory information in
MTInversionType
andMomentTensor.method_id
.
-
class
EvaluationMode
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Mode of an evaluation.
Used in
Pick
,Amplitude
,Magnitude
,Origin
,FocalMechanism
.
-
class
EvaluationStatus
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Status of an evaluation.
Used in
Pick
,Amplitude
,Magnitude
,Origin
,FocalMechanism
.
-
class
PickOnset
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Flag that roughly categorizes the sharpness of the onset.
-
class
EventType
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Describes the type of an event.
-
class
DataUsedWaveType
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Type of waveform data.
-
class
AmplitudeUnit
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Provides the most likely measurement units.
The measurement units for physical quantity are described in the
Amplitude.generic_amplitude
attribute. Possible values are specified as combination of SI base units.
-
class
EventDescriptionType
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Category of earthquake description.
-
class
MomentTensorCategory
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Category of moment tensor inversion.
-
class
EventTypeCertainty
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Denotes how certain the information on event type is.
-
class
SourceTimeFunctionType
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Type of source time function.
-
class
PickPolarity
(dummy) → None[source]¶ Bases:
pyrocko.guts.StringChoice
Any
str
out of['positive', 'negative', 'undecidable']
.
-
class
RealQuantity
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.
-
♦
value
¶ float
-
♦
uncertainty
¶ float
, optional
-
♦
lower_uncertainty
¶ float
, optional
-
♦
upper_uncertainty
¶ float
, optional
-
♦
confidence_level
¶ float
, optional
-
♦
-
class
IntegerQuantity
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Undocumented.
-
♦
value
¶ int
-
♦
uncertainty
¶ int
, optional
-
♦
lower_uncertainty
¶ int
, optional
-
♦
upper_uncertainty
¶ int
, optional
-
♦
confidence_level
¶ float
, optional
-
♦
-
class
ConfidenceEllipsoid
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of the location uncertainty as a confidence ellipsoid with arbitrary orientation in space.
-
♦
semi_major_axis_length
¶ float
-
♦
semi_minor_axis_length
¶ float
-
♦
semi_intermediate_axis_length
¶ float
-
♦
major_axis_plunge
¶ float
-
♦
major_axis_azimuth
¶ float
-
♦
major_axis_rotation
¶ float
-
♦
-
class
TimeQuantity
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of a point in time.
It’s given in ISO 8601 format, with optional symmetric or asymmetric uncertainties given in seconds. The time has to be specified in UTC.
-
♦
value
¶ time_float
-
♦
uncertainty
¶ float
, optional
-
♦
lower_uncertainty
¶ float
, optional
-
♦
upper_uncertainty
¶ float
, optional
-
♦
confidence_level
¶ float
, optional
-
♦
-
class
TimeWindow
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of a time window for amplitude measurements.
Which is given by a central point in time, and points in time before and after this central point. Both points before and after may coincide with the central point.
-
♦
begin
¶ float
-
♦
end
¶ float
-
♦
reference
¶ time_float
-
♦
-
class
ResourceReference
(dummy) → None[source]¶ Bases:
pyrocko.io.quakeml.ResourceIdentifier
This type is used to refer to QuakeML resources as described in Sect. 3.1 in the QuakeML manual.
-
class
DataUsed
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of the type of data used in a moment-tensor inversion.
-
♦
wave_type
¶ str
(DataUsedWaveType
)
-
♦
station_count
¶ int
, optional
-
♦
component_count
¶ int
, optional
-
♦
shortest_period
¶ float
, optional
-
♦
longest_period
¶ float
, optional
-
♦
-
class
EventDescription
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Free-form string with additional event description.
This can be a well-known name, like 1906 San Francisco Earthquake. A number of categories can be given in
type
.-
♦
text
¶ str
-
♦
type
¶ str
(EventDescriptionType
), optional
-
♦
-
class
SourceTimeFunction
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Source time function used in moment-tensor inversion.
-
♦
type
¶ str
(SourceTimeFunctionType
)
-
♦
duration
¶ float
-
♦
rise_time
¶ float
, optional
-
♦
decay_time
¶ float
, optional
-
♦
-
class
OriginQuality
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of an origin’s quality.
It contains various attributes commonly used to describe the quality of an origin, e. g., errors, azimuthal coverage, etc.
Origin
objects have an optional attribute of the typeOriginQuality
.-
♦
associated_phase_count
¶ int
, optional
-
♦
used_phase_count
¶ int
, optional
-
♦
associated_station_count
¶ int
, optional
-
♦
used_station_count
¶ int
, optional
-
♦
depth_phase_count
¶ int
, optional
-
♦
standard_error
¶ float
, optional
-
♦
azimuthal_gap
¶ float
, optional
-
♦
secondary_azimuthal_gap
¶ float
, optional
-
♦
ground_truth_level
¶ str
(GroundTruthLevel
), optional
-
♦
maximum_distance
¶ float
, optional
-
♦
minimum_distance
¶ float
, optional
-
♦
median_distance
¶ float
, optional
-
♦
-
class
Axis
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of an eigenvector of a moment tensor.
Which is expressed in its principal-axes system and uses the angles
azimuth
,plunge
, and the eigenvaluelength
.-
♦
azimuth
¶
-
♦
plunge
¶
-
♦
length
¶
-
♦
-
class
Tensor
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of the six independent moment-tensor elements in spherical coordinates.
These are the moment-tensor elements Mrr, Mtt, Mpp, Mrt, Mrp, Mtp in the spherical coordinate system defined by local upward vertical (r), North-South (t), and West-East (p) directions.
-
♦
mrr
¶
-
♦
mtt
¶
-
♦
mpp
¶
-
♦
mrt
¶
-
♦
mrp
¶
-
♦
mtp
¶
-
♦
-
class
NodalPlane
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of a nodal plane of a focal mechanism.
-
♦
strike
¶
-
♦
dip
¶
-
♦
rake
¶
-
♦
-
class
CompositeTime
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of a time instant.
If the specification is given with no greater accuracy than days (i.e., no time components are given), the date refers to local time. However, if time components are given, they have to refer to UTC.
-
♦
year
¶ IntegerQuantity
, optional
-
♦
month
¶ IntegerQuantity
, optional
-
♦
day
¶ IntegerQuantity
, optional
-
♦
hour
¶ IntegerQuantity
, optional
-
♦
minute
¶ IntegerQuantity
, optional
-
♦
second
¶ RealQuantity
, optional
-
♦
-
class
OriginUncertainty
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of the location uncertainties of an origin.
The uncertainty can be described either as a simple circular horizontal uncertainty, an uncertainty ellipse according to IMS1.0, or a confidence ellipsoid. If multiple uncertainty models are given, the preferred variant can be specified in the attribute
preferred_description
.-
♦
horizontal_uncertainty
¶ float
, optional
-
♦
min_horizontal_uncertainty
¶ float
, optional
-
♦
max_horizontal_uncertainty
¶ float
, optional
-
♦
azimuth_max_horizontal_uncertainty
¶ float
, optional
-
♦
confidence_ellipsoid
¶ ConfidenceEllipsoid
, optional
-
♦
preferred_description
¶ str
(OriginUncertaintyDescription
), optional
-
♦
confidence_level
¶ float
, optional
-
♦
-
class
CreationInfo
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of creation metadata (author, version, and creation time) of a resource.
-
♦
agency_uri
¶ str
(ResourceReference
), optional
str
(Author
), optional
str
(ResourceReference
), optional
-
♦
creation_time
¶ time_float, optional
-
♦
-
class
StationMagnitudeContribution
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of the weighting of magnitude values from several
StationMagnitude
objects for computing a network magnitude estimation.-
♦
station_magnitude_id
¶ str
(ResourceReference
)
-
♦
residual
¶ float
, optional
-
♦
weight
¶ float
, optional
-
♦
-
class
PrincipalAxes
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of the principal axes of a moment tensor.
-
class
NodalPlanes
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of the nodal planes of a moment tensor.
The attribute
preferred_plane
can be used to define which plane is the preferred one.-
♦
preferred_plane
¶ int
, optional
-
♦
nodal_plane1
¶ NodalPlane
, optional
-
♦
nodal_plane2
¶ NodalPlane
, optional
-
♦
-
class
WaveformStreamID
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Reference to a stream description in an inventory.
This is mostly equivalent to the combination of networkCode, stationCode, locationCode, and channelCode. However, additional information, e.g., sampling rate, can be referenced by the resourceURI. It is recommended to use resourceURI as a flexible, abstract, and unique stream ID that allows to describe different processing levels, or resampled/filtered products of the same initial stream, without violating the intrinsic meaning of the legacy identifiers (
network_code
,station_code
,channel_code
, andlocation_code
). However, for operation in the context of legacy systems, the classical identifier components are supported.-
♦
value
¶
-
♦
network_code
¶ str
(AnonymousNetworkCode
)
-
♦
station_code
¶ str
(AnonymousStationCode
)
-
♦
channel_code
¶ str
(AnonymousChannelCode
), optional
-
♦
location_code
¶ str
(AnonymousLocationCode
), optional
-
♦
-
class
Comment
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Comment to a resource together with author and creation time information.
-
♦
id
¶ str
(ResourceReference
), optional
-
♦
text
¶ str
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
MomentTensor
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of a moment tensor solution for an event.
It is an optional part of a
FocalMechanism
description.-
♦
public_id
¶ str
(ResourceReference
)
-
♦
derived_origin_id
¶ str
(ResourceReference
), optional
-
♦
moment_magnitude_id
¶ str
(ResourceReference
), optional
-
♦
scalar_moment
¶ RealQuantity
, optional
-
♦
variance
¶ float
, optional
-
♦
variance_reduction
¶ float
, optional
-
♦
double_couple
¶ float
, optional
-
♦
clvd
¶ float
, optional
-
♦
iso
¶ float
, optional
-
♦
greens_function_id
¶ str
(ResourceReference
), optional
-
♦
filter_id
¶ str
(ResourceReference
), optional
-
♦
source_time_function
¶ SourceTimeFunction
, optional
-
♦
method_id
¶ str
(ResourceReference
), optional
-
♦
category
¶ str
(MomentTensorCategory
), optional
-
♦
inversion_type
¶ str
(MTInversionType
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
Amplitude
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Quantification of the waveform anomaly.
Usually it consists of a single amplitude measurement or a measurement of the visible signal duration for duration magnitudes.
-
♦
public_id
¶ str
(ResourceReference
)
-
♦
generic_amplitude
¶
-
♦
category
¶ str
(AmplitudeCategory
), optional
-
♦
unit
¶ str
(AmplitudeUnit
), optional
-
♦
method_id
¶ str
(ResourceReference
), optional
-
♦
period
¶ RealQuantity
, optional
-
♦
snr
¶ float
, optional
-
♦
time_window
¶ TimeWindow
, optional
-
♦
pick_id
¶ str
(ResourceReference
), optional
-
♦
waveform_id
¶ WaveformStreamID
, optional
-
♦
filter_id
¶ str
(ResourceReference
), optional
-
♦
scaling_time
¶ TimeQuantity
, optional
-
♦
magnitude_hint
¶ str
(MagnitudeHint
), optional
-
♦
evaluation_mode
¶ str
(EvaluationMode
), optional
-
♦
evaluation_status
¶ str
(EvaluationStatus
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
Magnitude
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of a magnitude value.
It can, but does not need to be associated with an origin. Association with an origin is expressed with the optional attribute
origin_id
. It is either a combination of different magnitude estimations, or it represents the reported magnitude for the given event.-
♦
public_id
¶ str
(ResourceReference
)
-
♦
station_magnitude_contribution_list
¶ list
ofStationMagnitudeContribution
objects, default:[]
-
♦
mag
¶
-
♦
origin_id
¶ str
(ResourceReference
), optional
-
♦
method_id
¶ str
(ResourceReference
), optional
-
♦
station_count
¶ int
, optional
-
♦
azimuthal_gap
¶ float
, optional
-
♦
evaluation_mode
¶ str
(EvaluationMode
), optional
-
♦
evaluation_status
¶ str
(EvaluationStatus
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
StationMagnitude
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of a magnitude derived from a single waveform stream.
-
♦
public_id
¶ str
(ResourceReference
)
-
♦
origin_id
¶ str
(ResourceReference
), optional
-
♦
mag
¶
-
♦
amplitude_id
¶ str
(ResourceReference
), optional
-
♦
method_id
¶ str
(ResourceReference
), optional
-
♦
waveform_id
¶ WaveformStreamID
, optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
Arrival
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Successful association of a pick with an origin qualifies this pick as an arrival.
An arrival thus connects a pick with an origin and provides additional attributes that describe this relationship. Usually qualification of a pick as an arrival for a given origin is a hypothesis, which is based on assumptions about the type of arrival (phase) as well as observed and (on the basis of an earth model) computed arrival times, or the residual, respectively. Additional pick attributes like the horizontal slowness and backazimuth of the observed wave—especially if derived from array data—may further constrain the nature of the arrival.
-
♦
public_id
¶ str
(ResourceReference
)
-
♦
pick_id
¶ str
(ResourceReference
)
-
♦
time_correction
¶ float
, optional
-
♦
azimuth
¶ float
, optional
-
♦
distance
¶ float
, optional
-
♦
takeoff_angle
¶ RealQuantity
, optional
-
♦
time_residual
¶ float
, optional
-
♦
horizontal_slowness_residual
¶ float
, optional
-
♦
backazimuth_residual
¶ float
, optional
-
♦
time_weight
¶ float
, optional
-
♦
time_used
¶ int
, optional
-
♦
horizontal_slowness_weight
¶ float
, optional
-
♦
backazimuth_weight
¶ float
, optional
-
♦
earth_model_id
¶ str
(ResourceReference
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
Pick
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
A pick is the observation of an amplitude anomaly in a seismogram at a specific point in time.
It is not necessarily related to a seismic event.
-
♦
public_id
¶ str
(ResourceReference
)
-
♦
time
¶
-
♦
waveform_id
¶
-
♦
filter_id
¶ str
(ResourceReference
), optional
-
♦
method_id
¶ str
(ResourceReference
), optional
-
♦
horizontal_slowness
¶ RealQuantity
, optional
-
♦
backazimuth
¶ RealQuantity
, optional
-
♦
slowness_method_id
¶ str
(ResourceReference
), optional
-
♦
polarity
¶ str
(PickPolarity
), optional
-
♦
evaluation_mode
¶ str
(EvaluationMode
), optional
-
♦
evaluation_status
¶ str
(EvaluationStatus
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
FocalMechanism
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Description of the focal mechanism of an event.
It includes different descriptions like nodal planes, principal axes, and a moment tensor. The moment tensor description is provided by objects of the class
MomentTensor
which can be specified as child elements ofFocalMechanism
.-
♦
public_id
¶ str
(ResourceReference
)
-
♦
waveform_id_list
¶ list
ofWaveformStreamID
objects, default:[]
-
♦
moment_tensor_list
¶ list
ofMomentTensor
objects, default:[]
-
♦
triggering_origin_id
¶ str
(ResourceReference
), optional
-
♦
nodal_planes
¶ NodalPlanes
, optional
-
♦
principal_axes
¶ PrincipalAxes
, optional
-
♦
azimuthal_gap
¶ float
, optional
-
♦
station_polarity_count
¶ int
, optional
-
♦
misfit
¶ float
, optional
-
♦
station_distribution_ratio
¶ float
, optional
-
♦
method_id
¶ str
(ResourceReference
), optional
-
♦
evaluation_mode
¶ str
(EvaluationMode
), optional
-
♦
evaluation_status
¶ str
(EvaluationStatus
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
Origin
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of the focal time and geographical location of an earthquake hypocenter, as well as additional meta-information.
Origin
can have objects of typeOriginUncertainty
andArrival
as child elements.-
♦
public_id
¶ str
(ResourceReference
)
-
♦
composite_time_list
¶ list
ofCompositeTime
objects, default:[]
-
♦
origin_uncertainty_list
¶ list
ofOriginUncertainty
objects, default:[]
-
♦
time
¶
-
♦
longitude
¶
-
♦
latitude
¶
-
♦
depth
¶ RealQuantity
, optional
-
♦
depth_type
¶ str
(OriginDepthType
), optional
-
♦
time_fixed
¶ bool
, optional
-
♦
epicenter_fixed
¶ bool
, optional
-
♦
reference_system_id
¶ str
(ResourceReference
), optional
-
♦
method_id
¶ str
(ResourceReference
), optional
-
♦
earth_model_id
¶ str
(ResourceReference
), optional
-
♦
quality
¶ OriginQuality
, optional
-
♦
type
¶ str
(OriginType
), optional
-
♦
evaluation_mode
¶ str
(EvaluationMode
), optional
-
♦
evaluation_status
¶ str
(EvaluationStatus
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
Event
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
Representation of a seismic event.
The Event does not necessarily need to be a tectonic earthquake. An event is usually associated with one or more origins, which contain information about focal time and geographical location of the event. Multiple origins can cover automatic and manual locations, a set of location from different agencies, locations generated with different location programs and earth models, etc. Furthermore, an event is usually associated with one or more magnitudes, and with one or more focal mechanism determinations. In standard QuakeML-BED,
Origin
,Magnitude
,StationMagnitude
, andFocalMechanism
are child elements of Event. In BED-RT all these elements are on the same hierarchy level as child elements ofEventParameters
. The association of origins, magnitudes, and focal mechanisms to a particular event is expressed using references insideEvent
.-
♦
public_id
¶ str
(ResourceReference
)
-
♦
description_list
¶ list
ofEventDescription
objects, default:[]
-
♦
focal_mechanism_list
¶ list
ofFocalMechanism
objects, default:[]
-
♦
station_magnitude_list
¶ list
ofStationMagnitude
objects, default:[]
-
♦
preferred_origin_id
¶ str
(ResourceReference
), optional
-
♦
preferred_magnitude_id
¶ str
(ResourceReference
), optional
-
♦
preferred_focal_mechanism_id
¶ str
(ResourceReference
), optional
-
♦
type_certainty
¶ str
(EventTypeCertainty
), optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
EventParameters
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
In the bulletin-type (non real-time) model, this class serves as a container for Event objects.
In the real-time version, it can hold objects of type
Event
,Origin
,Magnitude
,StationMagnitude
,FocalMechanism
, Reading,Amplitude
andPick
(real-time mode is not covered by this module at the moment).-
♦
public_id
¶ str
(ResourceReference
)
-
♦
description
¶ str
, optional
-
♦
creation_info
¶ CreationInfo
, optional
-
♦
-
class
QuakeML
(**kwargs)[source]¶ Bases:
pyrocko.guts.Object
QuakeML data container.
-
♦
event_parameters
¶ EventParameters
, optional
-
get_pyrocko_events
()[source]¶ Get event information in Pyrocko’s basic event format.
Return type: List of pyrocko.model.event.Event
objects.
-
get_pyrocko_phase_markers
()[source]¶ Get pick information in Pyrocko’s basic marker format.
Return type: List of pyrocko.gui.marker.PhaseMarker
objects.
-
♦