pyrocko.io.quakeml

exception QuakeMLError[source]
exception NoPreferredOriginSet[source]
class ResourceIdentifier(dummy) → None[source]

Any str matching pattern "^(smi|quakeml):[\\w\\d][\\w\\d\\-\\.\\*\\(\\)_~']{2,}/[\\w\\d\\-\\.\\*\\(\\)_~'][\\w\\d\\-\\.\\*\\(\\)\\+\\?_~'=,;#/&]*$".

class WhitespaceOrEmptyStringType(dummy) → None[source]

Any str matching pattern '^\\s*$'.

class OriginUncertaintyDescription(dummy) → None[source]

Any str out of ['horizontal uncertainty', 'uncertainty ellipse', 'confidence ellipsoid'].

class AmplitudeCategory(dummy) → None[source]

Any str out of ['point', 'mean', 'duration', 'period', 'integral', 'other'].

class OriginDepthType(dummy) → None[source]

Any str out of ['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'].

class OriginType(dummy) → None[source]

Any str out of ['hypocenter', 'centroid', 'amplitude', 'macroseismic', 'rupture start', 'rupture end'].

class MTInversionType(dummy) → None[source]

Any str out of ['general', 'zero trace', 'double couple'].

class EvaluationMode(dummy) → None[source]

Any str out of ['manual', 'automatic'].

class EvaluationStatus(dummy) → None[source]

Any str out of ['preliminary', 'confirmed', 'reviewed', 'final', 'rejected'].

class PickOnset(dummy) → None[source]

Any str out of ['emergent', 'impulsive', 'questionable'].

class EventType(dummy) → None[source]

Any str out of ['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', 'duplicate earthquake', 'rockburst'].

class DataUsedWaveType(dummy) → None[source]

Any str out of ['P waves', 'body waves', 'surface waves', 'mantle waves', 'combined', 'unknown'].

class AmplitudeUnit(dummy) → None[source]

Any str out of ['m', 's', 'm/s', 'm/(s*s)', 'm*s', 'dimensionless', 'other'].

class EventDescriptionType(dummy) → None[source]

Any str out of ['felt report', 'Flinn-Engdahl region', 'local time', 'tectonic summary', 'nearest cities', 'earthquake name', 'region name'].

class MomentTensorCategory(dummy) → None[source]

Any str out of ['teleseismic', 'regional'].

class EventTypeCertainty(dummy) → None[source]

Any str out of ['known', 'suspected'].

class SourceTimeFunctionType(dummy) → None[source]

Any str out of ['box car', 'triangle', 'trapezoid', 'unknown'].

class PickPolarity(dummy) → None[source]

Any str out of ['positive', 'negative', 'undecidable'].

class AgencyID(dummy) → None[source]

Undocumented.

class Author(dummy) → None[source]

Undocumented.

class Version(dummy) → None[source]

Undocumented.

class Phase(**kwargs)[source]

Undocumented.

value

str

class GroundTruthLevel(dummy) → None[source]

Undocumented.

class AnonymousNetworkCode(dummy) → None[source]

Undocumented.

class AnonymousStationCode(dummy) → None[source]

Undocumented.

class AnonymousChannelCode(dummy) → None[source]

Undocumented.

class AnonymousLocationCode(dummy) → None[source]

Undocumented.

class Type(dummy) → None[source]

Undocumented.

class MagnitudeHint(dummy) → None[source]

Undocumented.

class Region(dummy) → None[source]

Undocumented.

class RealQuantity(**kwargs)[source]

Undocumented.

value

float

uncertainty

float, optional

lower_uncertainty

float, optional

upper_uncertainty

float, optional

confidence_level

float, optional

class IntegerQuantity(**kwargs)[source]

Undocumented.

value

int

uncertainty

int, optional

lower_uncertainty

int, optional

upper_uncertainty

int, optional

confidence_level

float, optional

class ConfidenceEllipsoid(**kwargs)[source]

Undocumented.

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]

Undocumented.

value

time_float

uncertainty

float, optional

lower_uncertainty

float, optional

upper_uncertainty

float, optional

confidence_level

float, optional

class TimeWindow(**kwargs)[source]

Undocumented.

begin

float

end

float

reference

time_float

class ResourceReference(dummy) → None[source]

Any str matching pattern "^(smi|quakeml):[\\w\\d][\\w\\d\\-\\.\\*\\(\\)_~']{2,}/[\\w\\d\\-\\.\\*\\(\\)_~'][\\w\\d\\-\\.\\*\\(\\)\\+\\?_~'=,;#/&]*$".

class DataUsed(**kwargs)[source]

Undocumented.

wave_type

str (DataUsedWaveType)

station_count

int, optional

component_count

int, optional

shortest_period

float, optional

longest_period

float, optional

class EventDescription(**kwargs)[source]

Undocumented.

text

str

type

str (EventDescriptionType), optional

class SourceTimeFunction(**kwargs)[source]

Undocumented.

type

str (SourceTimeFunctionType)

duration

float

rise_time

float, optional

decay_time

float, optional

class OriginQuality(**kwargs)[source]

Undocumented.

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]

Undocumented.

azimuth

RealQuantity

plunge

RealQuantity

length

RealQuantity

class Tensor(**kwargs)[source]

Undocumented.

mrr

RealQuantity

mtt

RealQuantity

mpp

RealQuantity

mrt

RealQuantity

mrp

RealQuantity

mtp

RealQuantity

class NodalPlane(**kwargs)[source]

Undocumented.

strike

RealQuantity

dip

RealQuantity

rake

RealQuantity

class CompositeTime(**kwargs)[source]

Undocumented.

year

IntegerQuantity, optional

month

IntegerQuantity, optional

day

IntegerQuantity, optional

hour

IntegerQuantity, optional

minute

IntegerQuantity, optional

second

RealQuantity, optional

class OriginUncertainty(**kwargs)[source]

Undocumented.

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 ResourceReferenceOptional(dummy) → None[source]

Undocumented.

class CreationInfo(**kwargs)[source]

Undocumented.

agency_id

str (AgencyID), optional

agency_uri

str (ResourceReference), optional

author

str (Author), optional

author_uri

str (ResourceReference), optional

creation_time

time_float, optional

version

str (Version), optional

class StationMagnitudeContribution(**kwargs)[source]

Undocumented.

station_magnitude_id

str (ResourceReference)

residual

float, optional

weight

float, optional

class PrincipalAxes(**kwargs)[source]

Undocumented.

t_axis

Axis

p_axis

Axis

n_axis

Axis, optional

class NodalPlanes(**kwargs)[source]

Undocumented.

preferred_plane

int, optional

nodal_plane1

NodalPlane, optional

nodal_plane2

NodalPlane, optional

class WaveformStreamID(**kwargs)[source]

Undocumented.

value

str (ResourceReferenceOptional)

network_code

str (AnonymousNetworkCode)

station_code

str (AnonymousStationCode)

channel_code

str (AnonymousChannelCode), optional

location_code

str (AnonymousLocationCode), optional

class Comment(**kwargs)[source]

Undocumented.

id

str (ResourceReference), optional

text

str

creation_info

CreationInfo, optional

class MomentTensor(**kwargs)[source]

Undocumented.

public_id

str (ResourceReference)

data_used_list

list of DataUsed objects, default: []

comment_list

list of Comment objects, default: []

derived_origin_id

str (ResourceReference), optional

moment_magnitude_id

str (ResourceReference), optional

scalar_moment

RealQuantity, optional

tensor

Tensor, 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]

Undocumented.

public_id

str (ResourceReference)

comment_list

list of Comment objects, default: []

generic_amplitude

RealQuantity

type

str (Type), optional

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]

Undocumented.

public_id

str (ResourceReference)

comment_list

list of Comment objects, default: []

station_magnitude_contribution_list

list of StationMagnitudeContribution objects, default: []

mag

RealQuantity

type

str (Type), optional

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]

Undocumented.

public_id

str (ResourceReference)

comment_list

list of Comment objects, default: []

origin_id

str (ResourceReference), optional

mag

RealQuantity

type

str (Type), optional

amplitude_id

str (ResourceReference), optional

method_id

str (ResourceReference), optional

waveform_id

WaveformStreamID, optional

creation_info

CreationInfo, optional

class Arrival(**kwargs)[source]

Undocumented.

public_id

str (ResourceReference)

comment_list

list of Comment objects, default: []

pick_id

str (ResourceReference)

phase

Phase

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]

Undocumented.

public_id

str (ResourceReference)

comment_list

list of Comment objects, default: []

time

TimeQuantity

waveform_id

WaveformStreamID

filter_id

str (ResourceReference), optional

method_id

str (ResourceReference), optional

horizontal_slowness

RealQuantity, optional

backazimuth

RealQuantity, optional

slowness_method_id

str (ResourceReference), optional

onset

str (PickOnset), optional

phase_hint

Phase, optional

polarity

str (PickPolarity), optional

evaluation_mode

str (EvaluationMode), optional

evaluation_status

str (EvaluationStatus), optional

creation_info

CreationInfo, optional

class FocalMechanism(**kwargs)[source]

Undocumented.

public_id

str (ResourceReference)

waveform_id_list

list of WaveformStreamID objects, default: []

comment_list

list of Comment objects, default: []

moment_tensor_list

list of MomentTensor 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]

Undocumented.

public_id

str (ResourceReference)

composite_time_list

list of CompositeTime objects, default: []

comment_list

list of Comment objects, default: []

origin_uncertainty_list

list of OriginUncertainty objects, default: []

arrival_list

list of Arrival objects, default: []

time

TimeQuantity

longitude

RealQuantity

latitude

RealQuantity

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

region

str (Region), optional

evaluation_mode

str (EvaluationMode), optional

evaluation_status

str (EvaluationStatus), optional

creation_info

CreationInfo, optional

class Event(**kwargs)[source]

Undocumented.

public_id

str (ResourceReference)

description_list

list of EventDescription objects, default: []

comment_list

list of Comment objects, default: []

focal_mechanism_list

list of FocalMechanism objects, default: []

amplitude_list

list of Amplitude objects, default: []

magnitude_list

list of Magnitude objects, default: []

station_magnitude_list

list of StationMagnitude objects, default: []

origin_list

list of Origin objects, default: []

pick_list

list of Pick objects, default: []

preferred_origin_id

str (ResourceReference), optional

preferred_magnitude_id

str (ResourceReference), optional

preferred_focal_mechanism_id

str (ResourceReference), optional

type

str (EventType), optional

type_certainty

str (EventTypeCertainty), optional

creation_info

CreationInfo, optional

region

str (Region), optional

get_pyrocko_event()[source]

Convert into Pyrocko event object.

Uses preferred origin, magnitude, and moment tensor. If no preferred item is specified, it picks the first from the list and emits a warning.

class EventParameters(**kwargs)[source]

Undocumented.

public_id

str (ResourceReference)

comment_list

list of Comment objects, default: []

event_list

list of Event objects, default: []

description

str, optional

creation_info

CreationInfo, optional

class QuakeML(**kwargs)[source]

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.
classmethod load_xml(stream=None, filename=None, string=None)[source]

Load QuakeML data from stream, file or string.

Parameters:
  • stream (file-like object, optional) – Stream open for reading in binary mode.
  • filename (str, optional) – Path to file to be opened for reading.
  • string (str, optional) – String with QuakeML data to be deserialized.

The arguments stream, filename, and string are mutually exclusive.

Returns:Parsed QuakeML data structure.
Return type:QuakeML object