obspy.io.quakeml.core.Pickler._station_magnitude

Pickler._station_magnitude(magnitude)[source]

Converts an StationMagnitude into etree.Element object.

Return type:etree.Element

Example

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