model.event

exception FileParseError[source]
exception EOF[source]
exception EmptyEvent[source]
class Event(lat=0.0, lon=0.0, time=0.0, name='', depth=None, magnitude=None, magnitude_type=None, region=None, load=None, loadf=None, catalog=None, moment_tensor=None, duration=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)
lat

float, default: 0.0

lon

float, default: 0.0

time

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

name

str, optional, default: ''

depth

float, optional

magnitude

float, optional

magnitude_type

str, optional

region

str, optional

catalog

str, optional

moment_tensor

pyrocko.moment_tensor.MomentTensor, optional

duration

float, optional

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)[source]

Write events file.

Parameters:
  • events – list of Event objects
  • filename – name of file as str