obspy.core.event.Catalog
- class Catalog(events=None, **kwargs)[source]
Bases:
object
This class serves as a container for
Event
objects.- Parameters
events (list of
Event
, optional) – List of eventsresource_id (
ResourceIdentifier
) – Resource identifier of the catalog.description (str, optional) – Description string that can be assigned to the earthquake catalog, or collection of events.
comments (list of
Comment
, optional) – Additional comments.creation_info (
CreationInfo
, optional) – Creation information used to describe author, version, and creation time.
Note
For handling additional information not covered by the QuakeML standard and how to output it to QuakeML see the ObsPy Tutorial.
Attributes
Public Methods
Appends a single Event object to the current Catalog object. |
|
Clears event list (convenient method). |
|
Returns a deepcopy of the Catalog object. |
|
Returns the number of Events in the Catalog object. |
|
Extends the current Catalog object with a list of Event objects. |
|
Returns a new Catalog object only containing Events which match the specified filter rules. |
|
Creates preview map of all events in current Catalog object. |
|
Saves catalog into a file. |
Private Methods
Warning
Private methods are mainly for internal/developer use and their API might change without notice.
Special Methods
- Catalog.__delattr__(name, /)
Implement delattr(self, name).
- Catalog.__delitem__(index)[source]
Passes on the __delitem__ method to the underlying list of traces.
- Catalog.__dir__()
Default dir() implementation.
- Catalog.__eq__(other)[source]
__eq__ method of the Catalog object.
- Parameters
other (
Catalog
) – Catalog object for comparison.- Return type
- Returns
True
if both Catalogs contain the same events.
Example
>>> from obspy.core.event import read_events >>> cat = read_events() >>> cat2 = cat.copy() >>> cat is cat2 False >>> cat == cat2 True
- Catalog.__format__(format_spec, /)
Default object formatter.
- Catalog.__ge__(value, /)
Return self>=value.
- Catalog.__getattribute__(name, /)
Return getattr(self, name).
- Catalog.__getslice__(i, j, k=1)[source]
__getslice__ method of the Catalog object.
- Returns
Catalog object
- Catalog.__gt__(value, /)
Return self>value.
- Catalog.__iadd__(other)[source]
Method to add two catalog with self += other.
It will extend the current Catalog object with the events of the given Catalog. Events will not be copied but references to the original events will be appended.
- Catalog.__init_subclass__()
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- Catalog.__iter__()[source]
Return a robust iterator for Events of current Catalog.
Doing this it is safe to remove events from catalogs inside of for-loops using catalog’s
remove()
method. Actually this creates a new iterator every time a event is removed inside the for-loop.
- Catalog.__le__(value, /)
Return self<=value.
- Catalog.__lt__(value, /)
Return self<value.
- Catalog.__new__(**kwargs)
- Catalog.__reduce__()
Helper for pickle.
- Catalog.__reduce_ex__(protocol, /)
Helper for pickle.
- Catalog.__repr__()
Return repr(self).
- Catalog.__setattr__(name, value, /)
Implement setattr(self, name, value).
- Catalog.__setstate__(state)[source]
Reset the resource id after being unpickled to ensure they are bound to the correct object.
- Catalog.__sizeof__()
Size of object in memory, in bytes.
- Catalog.__str__(print_all=False)[source]
Returns short summary string of the current catalog.
It will contain the number of Events in the Catalog and the return value of each Event’s
__str__()
method.- Parameters
print_all (bool, optional) – If True, all events will be printed, otherwise a maximum of ten event will be printed. Defaults to False.
- Catalog.__subclasshook__()
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).