# read\_inventory station.xml from gempa's station	management portal SMP

**URL:** https://discourse.obspy.org/t/read-inventory-station-xml-from-gempas-station-management-portal-smp/713
**Category:** Users Mailing List Archive
**Tags:** archive
**Created:** [November 9, 2017, 11:27am UTC](https://discourse.obspy.org/t/read-inventory-station-xml-from-gempas-station-management-portal-smp/713 "2017-11-09T11:27:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sigward\_Funke](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Sigward\_Funke](https://discourse.obspy.org/u/Sigward_Funke)
#### Post date: [November 9, 2017, 11:27am UTC](https://discourse.obspy.org/t/read-inventory-station-xml-from-gempas-station-management-portal-smp/713/1 "2017-11-09T11:27:15Z")

</div>

Dear people of ObsPy,

thanks for nice tools to display sensor characteristics like [1] or [2]. But  
sometimes I'm not able to import station.xml files created by Gempa's station  
management portal SMP, see attached file.

In case of appended file complete inventory was created using SMP. Same error  
messages I get after adding a new epoche to other existing stations using SMP.

In contrary to this error I successfully can read station.xml files exported  
from SMP without added epoches.

In all cases I use version 0.7 to export station.xml from SeisComP.

Some additional facts:  
\* ubuntu 16.04.3  
\* python 2.7.12 installed using apt-get install

Do you need some further details?

Best Regards  
Sigward Funke

$  
$ python  
Python 2.7.12 (default, Nov 19 2016, 06:48:10)  
[GCC 5.4.0 20160609] on linux2  
Type "help", "copyright", "credits" or "license" for more information.

> > > from obspy import read\_inventory
> > > 
> > > inv = read\_inventory("./SigwardFunke\_Sachsennetz\_LEUT.xml")

Traceback (most recent call last):  
&nbsp;&nbsp;File "\<stdin\>", line 1, in \<module\>  
&nbsp;&nbsp;File "\<decorator-gen-45\>", line 2, in read\_inventory  
&nbsp;&nbsp;File "/usr/lib/python2.7/dist-packages/obspy/core/util/decorator.py", line  
301, in \_map\_example\_filename  
&nbsp;&nbsp;&nbsp;&nbsp;return func(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "/usr/lib/python2.7/dist-packages/obspy/core/inventory/inventory.py",  
line 98, in read\_inventory  
&nbsp;&nbsp;&nbsp;&nbsp;format=format, \*args, \*\*kwargs)[0]  
&nbsp;&nbsp;File "/usr/lib/python2.7/dist-packages/obspy/core/util/base.py", line 412,  
in \_read\_from\_plugin  
&nbsp;&nbsp;&nbsp;&nbsp;list\_obj = read\_format(filename, \*\*kwargs)  
&nbsp;&nbsp;File "/usr/lib/python2.7/dist-packages/obspy/io/seiscomp/inventory.py", line  
83, in \_read\_sc3ml  
&nbsp;&nbsp;&nbsp;&nbsp;networks.append(\_read\_network(inv\_element, net\_element, \_ns))  
&nbsp;&nbsp;File "/usr/lib/python2.7/dist-packages/obspy/io/seiscomp/inventory.py", line  
136, in \_read\_network  
&nbsp;&nbsp;&nbsp;&nbsp;stations.append(\_read\_station(inventory\_root, sta\_element, \_ns))  
&nbsp;&nbsp;File "/usr/lib/python2.7/dist-packages/obspy/io/seiscomp/inventory.py", line  
199, in \_read\_station  
&nbsp;&nbsp;&nbsp;&nbsp;channels.append(\_read\_channel(inventory\_root, channel, \_ns))  
&nbsp;&nbsp;File "/usr/lib/python2.7/dist-packages/obspy/io/seiscomp/inventory.py", line  
389, in \_read\_channel  
&nbsp;&nbsp;&nbsp;&nbsp;\_read\_float\_var(temp / channel.sample\_rate, ClockDrift)  
TypeError: unsupported operand type(s) for /: 'NoneType' and 'SampleRate'

> > >

[1] [http://docs.obspy.org/packages/autogen/](http://docs.obspy.org/packages/autogen/)  
obspy.core.inventory.inventory.Inventory.plot\_response.html  
[2] [http://docs.obspy.org/packages/autogen/](http://docs.obspy.org/packages/autogen/)  
obspy.core.inventory.response.Response.plot.html

[SigwardFunke\_Sachsennetz\_LEUT.xml](https://discourse.obspy.org/uploads/short-url/rRUtwYpPGhZ4eKfR41RqOo1Vlfs.xml) (29 KB)

[Sfunke.vcf](https://discourse.obspy.org/uploads/short-url/ezvTtPHVemtnrcmNtv51YbrJ50X.vcf) (168 Bytes)

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [November 9, 2017, 12:14pm UTC](https://discourse.obspy.org/t/read-inventory-station-xml-from-gempas-station-management-portal-smp/713/2 "2017-11-09T12:14:29Z")

</div>

Hi Sigward,

this is a bug, I've opened an issue on github for this:  
[Bug in reading SC3ML (assumes optional maxClockDrift is always present) by megies · Pull Request #1993 · obspy/obspy · GitHub](https://github.com/obspy/obspy/pull/1993)

As a workaround you should be able to specify information on  
"Clock"\>"Max drift" in SMP, or add "maxClockDrift" tag manually in the  
SC3ML file inside data loggers.

best,  
T

---

<div class="post-metadata">

### Author: ![Sigward\_Funke](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Sigward\_Funke](https://discourse.obspy.org/u/Sigward_Funke)
#### Post date: [November 9, 2017, 3:22pm UTC](https://discourse.obspy.org/t/read-inventory-station-xml-from-gempas-station-management-portal-smp/713/3 "2017-11-09T15:22:59Z")

</div>

Hi Tobias,

thanks for fast and useful reaction.

Your workaround works fine; at least read\_inventory works in all 4 tested  
cases.

Best Regards  
Sigward
