[obspy-users] AttribDict

Mike Hagerty m.hagerty at isti.com
Mon Jun 4 15:04:37 CEST 2018


On Mon, Jun 4, 2018 at 4:54 AM, Tobias Megies <
megies at geophysik.uni-muenchen.de> wrote:
>
>
> Did you write that file yourself?
>

Hey Tobias, are you throwing me shade ?  :)
No, I didn't write the file, just trying to figure out if it was valid use
of AttribDict.

>
> Also, to avoid such issues in the future, you might want to consider to
> use "cat.write('/tmp/trash.xml', format='QUAKEML', validate=False)" which
> raises an AssertionError in the first (bad) usage case.
>

I think you mean 'validate=True' - but that just checks quakeML against the
schema (xsd), no ?
So, it's definitely violating the quakeML schema to use AttribDict this way
?

Cheers!
-Mike



>
> cheers,
> Tobias
>
>
>
> On 31/05/18 17:23, Mike Hagerty wrote:
>
>> I was given quakeML files that have blocks like this:
>>
>>        <magnitude publicID="smi:local/305afa78-3
>> 4cb-4e82-abe5-ef610b114c80">
>>          <mag>
>>            <value>-1.69791750681</value>
>>            <uncertainty>AttribDict({'error':
>> 0.06334087421841221})</uncertainty>
>>          </mag>
>>
>> obspy read_events() complains about the AttribDict:
>>
>> .../obspy/obspy/io/quakeml/core.py:181: UserWarning: Could not convert
>> AttribDict({'error': 0.70882453572021886}) to type <class 'float'>.
>> Returning None.
>>    warnings.warn(msg % (text, convert_to))
>>
>> Does anyone know if/how AttribDict is supposed to be used *within*
>> quakeML ?
>>
>>
>> Cheers!
>> -Mike
>>
>>
>> _______________________________________________
>> obspy-users mailing list
>> obspy-users at lists.swapbytes.de
>> https://lists.swapbytes.de/mailman/listinfo/obspy-users
>>
>>
> _______________________________________________
> obspy-users mailing list
> obspy-users at lists.swapbytes.de
> https://lists.swapbytes.de/mailman/listinfo/obspy-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.swapbytes.de/pipermail/obspy-users/attachments/20180604/522b5432/attachment.html>


More information about the obspy-users mailing list