obspy.io.quakeml.core.Unpickler._focal_mechanism

Unpickler._focal_mechanism(element)[source]

Converts an etree.Element into a FocalMechanism object.

Return type:FocalMechanism

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