Hi
I’ve made a station inventory using Gempa’s SMP tool. I’ve ensured the I export the xml as SC3XML/0.7, in line with Obspy.
However, when I try to read the inventory in Obspy, I get the following error:
Traceback (most recent call last):
File "./test.py", line 4, in <module>
inv = read_inventory('sph1r17_VOiLA-onshore-8.xml')
File "<decorator-gen-83>", line 2, in read_inventory
File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/core/util/decorator.py", line 294, in _map_example_filename
return func(*args, **kwargs)
File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/core/inventory/inventory.py", line 72, in read_inventory
format=format)[0]
File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/core/util/base.py", line 464, in _read_from_plugin
list_obj = read_format(filename, **kwargs)
File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/io/seiscomp/sc3ml.py", line 159, in _read_sc3ml
networks.append(_read_network(inv_element, net_element, _ns))
File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/io/seiscomp/sc3ml.py", line 209, in _read_network
stations.append(_read_station(inventory_root, sta_element, _ns))
File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/io/seiscomp/sc3ml.py", line 272, in _read_station
channels.append(_read_channel(inventory_root, channel, _ns))
File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/io/seiscomp/sc3ml.py", line 472, in _read_channel
response_element, cha_element,
UnboundLocalError: local variable 'response_element' referenced before assignment
The xml file is here if anyone would like to see it: https://www.dropbox.com/s/nso0fdtf5uj3yeo/sph1r17_VOiLA-onshore-8.xml?dl=0.
The smp repository can be found here: https://smp.gempa.de/sph1r17/VOiLA-onshore
The sensor and digitiser response seems to be correctly attached in the xml file.
Can anyone assist me here with trying to get to the root of the problem?
Thanks in advance for your help
Steve
Dr. Stephen Hicks
Postdoctoral Research Fellow in Passive Source Seismology
University of Southampton
T +44 (0)23 8059 9082 (ext: 29239) M +44 7718 286506 / +44 7775 694766
E s.hicks@soton.ac.uk<mailto:s.hicks@soton.ac.uk> Twitter @seismo_steve<http://www.twitter.com/seismo_steve>
W UoS profile<http://www.southampton.ac.uk/oes/about/staff/sphr1r17.page>
Room 786/14
Ocean and Earth Science, National Oceanography Centre Southampton