obspy.core.event.event.Event

class Event(*args, **kwargs)[source]

Bases: obspy.core.event.base._event_type_class_factory.<locals>.AbstractEventTypeWithResourceID

The class Event describes a seismic event which 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.

Parameters
  • resource_id (ResourceIdentifier) – Resource identifier of Event.

  • force_resource_id (bool, optional) – If set to False, the automatic initialization of resource_id attribute in case it is not specified will be skipped.

  • event_type (str, optional) – Describes the type of an event. See EventType for allowed values.

  • event_type_certainty (str, optional) – Denotes how certain the information on event type is. See EventTypeCertainty for allowed values.

  • creation_info (CreationInfo, optional) – Creation information used to describe author, version, and creation time.

  • event_descriptions (list of EventDescription) – Additional event description, like earthquake name, Flinn-Engdahl region, etc.

  • comments (list of Comment, optional) – Additional comments.

  • picks (list of Pick) – Picks associated with the event.

  • amplitudes (list of Amplitude) – Amplitudes associated with the event.

  • focal_mechanisms (list of FocalMechanism) – Focal mechanisms associated with the event

  • origins (list of Origin) – Origins associated with the event.

  • magnitudes (list of Magnitude) – Magnitudes associated with the event.

  • station_magnitudes (list of StationMagnitude) – Station magnitudes associated with the event.

Note

For handling additional information not covered by the QuakeML standard and how to output it to QuakeML see the ObsPy Tutorial.

Attributes

defaults

do_not_warn_on

item

key

readonly

warn_on_non_default_key

Public Methods

clear

Clear the class :return:

copy

get

items

keys

plot

Plot event location and/or the preferred focal mechanism and radiation pattern.

pop

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem

as a 2-tuple; but raise KeyError if D is empty.

preferred_focal_mechanism

Returns the preferred focal mechanism

preferred_magnitude

Returns the preferred magnitude

preferred_origin

Returns the preferred origin

scope_resource_ids

Ensure all resource_ids in event instance are event-scoped.

setdefault

short_str

Returns a short string representation of the current Event.

update

values

write

Saves event information into a file.

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

Event._cast_type(key, value)

Cast type of value to type required in _types dict.

Parameters
  • key (str) – The key from __setattr__.

  • value – The value being set to key.

Returns

value cast to correct type.

Event._pretty_str(priorized_keys=[], min_label_length=16)

Return better readable string representation of AttribDict object.

Parameters
  • priorized_keys (list[str], optional) – Keywords of current AttribDict which will be shown before all other keywords. Those keywords must exists otherwise an exception will be raised. Defaults to empty list.

  • min_label_length (int, optional) – Minimum label length for keywords. Defaults to 16.

Returns

String representation of current AttribDict object.

Event._repr_pretty_(p, cycle)[source]

Special Methods

Event.__bool__()
Event.__contains__(key)
Event.__deepcopy__(memodict=None)[source]

reset resource_id’s object_id after deep copy to allow the object specific behavior of get_referred_object

Event.__delattr__(name)
Event.__delitem__(name)
Event.__dir__()

Default dir() implementation.

Event.__eq__(other)

Two instances are considered equal if all attributes and all lists are identical.

Event.__format__(format_spec, /)

Default object formatter.

Event.__ge__(value, /)

Return self>=value.

Event.__getattr__(name, default=None)

Py3k hasattr() expects an AttributeError no KeyError to be raised if the attribute is not found.

Event.__getattribute__(name, /)

Return getattr(self, name).

Event.__getitem__(name, default=None)
Event.__gt__(value, /)

Return self>value.

Event.__init__(*args, **kwargs)[source]
Event.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

Event.__iter__()
Event.__le__(value, /)

Return self<=value.

Event.__len__()
Event.__lt__(value, /)

Return self<value.

Event.__ne__(other)
Event.__new__(**kwargs)
Event.__nonzero__()
Event.__reduce__()

Helper for pickle.

Event.__reduce_ex__(protocol, /)

Helper for pickle.

Event.__repr__()[source]
Event.__setattr__(name, value)

Custom property implementation that works if the class is inheriting from AttribDict.

Event.__setitem__(key, value)
Event.__setstate__(state_dict)[source]
Event.__sizeof__()

Size of object in memory, in bytes.

Event.__str__()[source]

Print a short summary at the top.

classmethod Event.__subclasshook__(C)