obspy.io.quakeml.core.Unpickler._magnitude

Unpickler._magnitude(element)[source]

Converts an etree.Element into a Magnitude object.

Return type:Magnitude

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