obspy.core.event.origin.Origin
- class Origin(force_resource_id=True, *args, **kwargs)[source]
Bases:
AbstractEventTypeWithResourceID
This class represents the focal time and geographical location of an earthquake hypocenter, as well as additional meta-information. Origin can have objects of type OriginUncertainty and Arrival as child elements.
- Parameters:
resource_id (
ResourceIdentifier
) – Resource identifier of Origin.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.
time (
UTCDateTime
) – Focal time.time_errors (
QuantityError
) – AttribDict containing error quantities.longitude (float) – Hypocenter longitude, with respect to the World Geodetic System 1984 (WGS84) reference system. Unit: deg
longitude_errors (
QuantityError
) – AttribDict containing error quantities.latitude (float) – Hypocenter latitude, with respect to the WGS84 reference system. Unit: deg
latitude_errors (
QuantityError
) – AttribDict containing error quantities.depth (float, optional) – Depth of hypocenter with respect to the nominal sea level given by the WGS84 geoid. Positive values indicate hypocenters below sea level. For shallow hypocenters, the depth value can be negative. Note: Other standards use different conventions for depth measurement. As an example, GSE2.0, defines depth with respect to the local surface. If event data is converted from other formats to QuakeML, depth values may have to be modified accordingly. Unit: m
depth_errors (
QuantityError
) – AttribDict containing error quantities.depth_type (str, optional) – Type of depth determination. See
OriginDepthType
for allowed values.time_fixed (bool, optional) – True if focal time was kept fixed for computation of the Origin.
epicenter_fixed (bool, optional) – True if epicenter was kept fixed for computation of Origin.
reference_system_id (
ResourceIdentifier
) – Identifies the reference system used for hypocenter determination. This is only necessary if a modified version of the standard (with local extensions) is used that provides a non-standard coordinate system.method_id (
ResourceIdentifier
) – Identifies the method used for locating the event.earth_model_id (
ResourceIdentifier
) – Identifies the earth model used in method_id.arrivals (list of
Arrival
, optional) – List of arrivals associated with the origin.composite_times (list of
CompositeTime
, optional) – Supplementary information on time of rupture start. Complex descriptions of focal times of historic events are possible, see description of the CompositeTime type. Note that even if compositeTime is used, the mandatory time attribute has to be set, too. It has to be set to the single point in time (with uncertainties allowed) that is most characteristic for the event.quality (
OriginQuality
, optional) – Additional parameters describing the quality of an Origin determination.origin_type (str, optional) – Describes the origin type. See
OriginType
for allowed values.origin_uncertainty (
OriginUncertainty
, optional) – Describes the location uncertainties of an origin.region (str, optional) – Can be used to describe the geographical region of the epicenter location. Useful if an event has multiple origins from different agencies, and these have different region designations. Note that an event-wide region can be defined in the description attribute of an Event object. The user has to take care that this information corresponds to the region attribute of the preferred Origin.
evaluation_mode (str, optional) – Evaluation mode of Origin. See
EvaluationMode
for allowed values.evaluation_status (str, optional) – Evaluation status of Origin. See
EvaluationStatus
for allowed values.comments (list of
Comment
, optional) – Additional comments.creation_info (
CreationInfo
, optional) – Creation information used to describe author, version, and creation time.
Example
>>> from obspy.core.event import Origin >>> origin = Origin() >>> origin.resource_id = 'smi:ch.ethz.sed/origin/37465' >>> origin.time = UTCDateTime(0) >>> origin.latitude = 12 >>> origin.latitude_errors.uncertainty = 0.01 >>> origin.latitude_errors.confidence_level = 95.0 >>> origin.longitude = 42 >>> origin.depth_type = 'from location' >>> print(origin) Origin resource_id: ResourceIdentifier(id="smi:ch.ethz.sed/...") time: UTCDateTime(1970, 1, 1, 0, 0) longitude: 42.0 latitude: 12.0 [confidence_level=95.0, uncertainty=0.01] depth_type: ...'from location'
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
Clear the class :return: |
|
If key is not found, d is returned if given, otherwise KeyError is raised. |
|
as a 2-tuple; but raise KeyError if D is empty. |
|
Private Methods
Warning
Private methods are mainly for internal/developer use and their API might change without notice.
- Origin._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.
- Origin._pretty_str(priorized_keys=[], min_label_length=16)
Return better readable string representation of AttribDict object.
- Parameters:
- Returns:
String representation of current AttribDict object.
- Origin._repr_pretty_(p, cycle)
Special Methods
- Origin.__bool__()
- classmethod Origin.__class_getitem__()
Represent a PEP 585 generic type
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
- Origin.__contains__(key)
- Origin.__delattr__(name)
- Origin.__delitem__(name)
- Origin.__dir__()
Default dir() implementation.
- Origin.__eq__(other)
Two instances are considered equal if all attributes and all lists are identical.
- Origin.__format__(format_spec, /)
Default object formatter.
- Origin.__ge__(value, /)
Return self>=value.
- Origin.__getattr__(name, default=None)
Py3k hasattr() expects an AttributeError no KeyError to be raised if the attribute is not found.
- Origin.__getattribute__(name, /)
Return getattr(self, name).
- Origin.__getitem__(name, default=None)
- Origin.__gt__(value, /)
Return self>value.
- Origin.__init__(force_resource_id=True, *args, **kwargs)
- Origin.__init_subclass__()
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- Origin.__iter__()
- Origin.__le__(value, /)
Return self<=value.
- Origin.__len__()
- Origin.__lt__(value, /)
Return self<value.
- Origin.__ne__(other)
- Origin.__new__(**kwargs)
- Origin.__reduce__()
Helper for pickle.
- Origin.__reduce_ex__(protocol, /)
Helper for pickle.
- Origin.__repr__()
- Origin.__setattr__(name, value)
Custom property implementation that works if the class is inheriting from AttribDict.
- Origin.__setitem__(key, value)
- Origin.__sizeof__()
Size of object in memory, in bytes.
- Origin.__str__(force_one_line=False)
Fairly extensive in an attempt to cover several use cases. It is always possible to change it in the child class.
- classmethod Origin.__subclasshook__(C)