Read station inventory - sc3ml


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 "./", 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/", line 294, in _map_example_filename
    return func(*args, **kwargs)
  File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/core/inventory/", line 72, in read_inventory
  File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/core/util/", line 464, in _read_from_plugin
    list_obj = read_format(filename, **kwargs)
  File "/Users/sph1r17/anaconda/lib/python3.5/site-packages/obspy/io/seiscomp/", 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/", 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/", 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/", 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:
The smp repository can be found here:

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

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<> Twitter @seismo_steve<>
W UoS profile<>

Room 786/14
Ocean and Earth Science, National Oceanography Centre Southampton

Hi Steve,

this has now been fixed ( and will be included in the 1.1.0 release.