obspy.io.quakeml.core.Unpickler
- class Unpickler(xml_doc=None)[source]
Bases:
object
De-serializes a QuakeML string into an ObsPy Catalog object.
Attributes
Public Methods
Reads QuakeML file into ObsPy catalog object. |
|
Parses QuakeML string into ObsPy catalog object. |
Private Methods
Warning
Private methods are mainly for internal/developer use and their API might change without notice.
- Unpickler._amplitude(element)[source]
Converts an etree.Element into a Amplitude object.
- Return type
- Unpickler._data_used(parent)[source]
Converts an etree.Element into a list of DataUsed objects.
- Return type
list of
DataUsed
- Unpickler._extra(element, obj)[source]
Add information stored in custom tags/attributes in obj.extra.
- Unpickler._focal_mechanism(element)[source]
Converts an etree.Element into a FocalMechanism object.
- Return type
Example
>>> from lxml import etree >>> XML = b'''<?xml version="1.0" encoding="UTF-8"?> ... <focalMechanism> ... <methodID>smi:ISC/methodID=Best_double_couple</methodID> ... </focalMechanism>''' >>> xml_doc = etree.fromstring(XML) >>> unpickler = Unpickler(xml_doc) >>> fm = unpickler._focal_mechanism(xml_doc) >>> print(fm.method_id) smi:ISC/methodID=Best_double_couple
- Unpickler._magnitude(element)[source]
Converts an etree.Element into a Magnitude object.
- Return type
Example
>>> from lxml import etree >>> XML = b'''<?xml version="1.0" encoding="UTF-8"?> ... <magnitude> ... <mag><value>3.2</value></mag> ... </magnitude>''' >>> xml_doc = etree.fromstring(XML) >>> unpickler = Unpickler(xml_doc) >>> magnitude = unpickler._magnitude(xml_doc) >>> print(magnitude.mag) 3.2
- Unpickler._moment_tensor(parent)[source]
Converts an etree.Element into an MomentTensor object.
- Return type
- Unpickler._nodal_plane(parent, name)[source]
Converts an etree.Element into an NodalPlane object.
- Parameters
name (str) – tag name of sub nodal plane
- Return type
- Unpickler._nodal_planes(parent)[source]
Converts an etree.Element into an NodalPlanes object.
- Return type
- Unpickler._origin(element, arrivals)[source]
Converts an etree.Element into an Origin object.
- Return type
Example
>>> from lxml import etree >>> XML = b'''<?xml version="1.0" encoding="UTF-8"?> ... <origin> ... <latitude><value>34.23</value></latitude> ... </origin>''' >>> xml_doc = etree.fromstring(XML) >>> unpickler = Unpickler(xml_doc) >>> origin = unpickler._origin(xml_doc, arrivals=[]) >>> print(origin.latitude) 34.23
- Unpickler._principal_axes(parent)[source]
Converts an etree.Element into an PrincipalAxes object.
- Return type
- Unpickler._source_time_function(parent)[source]
Converts an etree.Element into an SourceTimeFunction object.
- Return type
- Unpickler._station_magnitude(element)[source]
Converts an etree.Element into a StationMagnitude object.
- Return type
Example
>>> from lxml import etree >>> XML = b'''<?xml version="1.0" encoding="UTF-8"?> ... <stationMagnitude> ... <mag><value>3.2</value></mag> ... </stationMagnitude>''' >>> xml_doc = etree.fromstring(XML) >>> unpickler = Unpickler(xml_doc) >>> station_mag = unpickler._station_magnitude(xml_doc) >>> print(station_mag.mag) 3.2
- Unpickler._time_window(element)[source]
Converts an etree.Element into a TimeWindow object.
- Return type
Special Methods
- Unpickler.__delattr__(name, /)
Implement delattr(self, name).
- Unpickler.__dir__()
Default dir() implementation.
- Unpickler.__eq__(value, /)
Return self==value.
- Unpickler.__format__(format_spec, /)
Default object formatter.
- Unpickler.__ge__(value, /)
Return self>=value.
- Unpickler.__getattribute__(name, /)
Return getattr(self, name).
- Unpickler.__gt__(value, /)
Return self>value.
- Unpickler.__hash__()
Return hash(self).
- Unpickler.__init_subclass__()
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- Unpickler.__le__(value, /)
Return self<=value.
- Unpickler.__lt__(value, /)
Return self<value.
- Unpickler.__ne__(value, /)
Return self!=value.
- Unpickler.__new__(**kwargs)
- Unpickler.__reduce__()
Helper for pickle.
- Unpickler.__reduce_ex__(protocol, /)
Helper for pickle.
- Unpickler.__repr__()
Return repr(self).
- Unpickler.__setattr__(name, value, /)
Implement setattr(self, name, value).
- Unpickler.__sizeof__()
Size of object in memory, in bytes.
- Unpickler.__str__()
Return str(self).
- Unpickler.__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).