model.event

exception FileParseError[source]
exception EventExtrasDumpError[source]
exception EOF[source]
exception EmptyEvent[source]
class Tag(dummy) → str[source]

Any str matching pattern '^[A-Za-z][A-Za-z0-9._]{0,128}(:[A-Za-z0-9._-]*)?$'.

class Event(lat=0.0, lon=0.0, north_shift=0.0, east_shift=0.0, time=0.0, name='', depth=None, elevation=None, magnitude=None, magnitude_type=None, region=None, load=None, loadf=None, catalog=None, moment_tensor=None, duration=None, tags=None, extras=None)[source]

Seismic event representation

Parameters:
  • lat – latitude of hypocenter (default 0.0)
  • lon – longitude of hypocenter (default 0.0)
  • time – origin time as float in seconds after ‘1970-01-01 00:00:00
  • name – event identifier as string (optional)
  • depth – source depth (optional)
  • magnitude – magnitude of event (optional)
  • region – source region (optional)
  • catalog – name of catalog that lists this event (optional)
  • moment_tensor – moment tensor as moment_tensor.MomentTensor instance (optional)
  • duration – source duration as float (optional)
  • tags – list of tags describing event (optional)
  • extras – dictionary for user defined event attributes (optional). Keys must be strings, values must be YAML serializable.
time

builtins.float (pyrocko.guts.Timestamp), default: 0.0

depth

float, optional

name

str, optional, default: ''

magnitude

float, optional

magnitude_type

str, optional

region

str, optional

catalog

str, optional

moment_tensor

pyrocko.moment_tensor.MomentTensor, optional

duration

float, optional

tags

list of builtins.str (Tag) objects, default: []

extras

dict of pyrocko.guts.Any objects, default: {}

load_events(filename, format='detect')[source]

Read events file.

Parameters:
  • filename – name of file as str
  • format – file format: 'detect', 'basic', or 'yaml'
Returns:

list of Event objects

exception OneEventRequired[source]
dump_events(events, filename=None, stream=None, format='basic')[source]

Write events file.

Parameters:
  • events – list of Event objects
  • filename – name of file as str
  • format – file format: 'basic', or 'yaml'