obspy.io.quakeml.core.Pickler._origin

Pickler._origin(origin)[source]

Converts an Origin into etree.Element object.

Return type:etree.Element

Example

>>> from obspy.io.quakeml.core import Pickler
>>> from obspy.core.event import Origin
>>> from lxml.etree import tostring
>>> origin = Origin()
>>> origin.latitude = 34.23
>>> el = Pickler()._origin(origin)
>>> print(tostring(el, encoding="utf-8",
...                xml_declaration=True).decode())                 
<?xml version='1.0' encoding='utf-8'?>
<origin ...<latitude><value>34.23</value></latitude>...</origin>