obspy.io.quakeml.core.Pickler._magnitude

Pickler._magnitude(magnitude)[source]

Converts an Magnitude into etree.Element object.

Return type:etree.Element

Example

>>> from obspy.io.quakeml.core import Pickler
>>> from obspy.core.event import Magnitude
>>> from lxml.etree import tostring
>>> magnitude = Magnitude()
>>> magnitude.mag = 3.2
>>> el = Pickler()._magnitude(magnitude)
>>> print(tostring(el, encoding="utf-8",
...                xml_declaration=True).decode())                 
<?xml version='1.0' encoding='utf-8'?>
<magnitude ...<mag><value>3.2</value></mag>...</magnitude>