I learned to read QML (QuakeML) files for Events by using Event.preferred_origin() and preferred_magnitude(). Now I’m given a QML file that was created by EqTransformer. None of the events have a magnitude - so I test if preferred_magnitude() is None. But then I discover that preferred_origin() also returns None! But the QML file has legitimate origin tag.
Some googling shows me that I can use event.origins. Yep, that works for hypocenter.
So what’s wrong? Why does preferred_origin return None? Has EqTransformer written QML incorrectly? Or does ObsPy have a bug? Here’s the start of an event:
<event publicID="smi:local/9d605234-f25f-4397-ae4c-ba8a8aa5f94a"> <origin publicID="smi:local/5b7d3764-06c7-4713-af00-8455d4763c9b"> <time> <value>2018-08-13T19:23:58.381599Z</value> </time> <latitude> <value>54.9151</value> <uncertainty>X</uncertainty> </latitude>