obspy.io.quakeml.core.Unpickler._station_magnitude

Unpickler._station_magnitude(element)[source]

Converts an etree.Element into a StationMagnitude object.

Return type:StationMagnitude

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