SeisComP3 / seiscomp3

SeisComP is a seismological software for data acquisition, processing, distribution and interactive analysis.
Other
111 stars 87 forks source link

"unknown data format" error produced by inv2dlsv #84

Closed ghost closed 5 years ago

ghost commented 7 years ago

When converting an inventory to seed using inv2dlsv I consistently get and error of the form Error (,,,): unknown data format the first time a channel is added to the volume. For instance:

curl -s  'http://service.iris.edu/fdsnws/station/1/query?nodata=404&level=response&network=HK&station=HKPS&channel=BH?' 3>/dev/null | import_inv fdsnxml - - | inv2dlsv - /dev/null                                                           

produces the output:

No inventory read from inventory db
Create empty one
Processing -
 - parsing StationXML
12:09:42 [warning] Comment: missing mandatory attribute: id
12:09:42 [warning] Comment: missing mandatory attribute: id
12:09:42 [warning] Comment: missing mandatory attribute: id
12:09:42 [warning] Comment: missing mandatory attribute: id
12:09:42 [warning] Comment: missing mandatory attribute: id
12:09:42 [warning] Comment: missing mandatory attribute: id
 - converting into SeisComP-XML
Finished processing
Writing inventory to -
Error (HK,HKPS,,BHZ): unknown data format: 

This error appears to be thrown from line 1128 of src/utils/libs/python/seiscomp/fseed.py (in commit 6ee54de15b). My suspicion is that this is some sort of initialisation problem, though I have not spent the time to either confirm this or track it down. I have, however, managed to create a workaround which can be found here. The workaround is to try adding a channel a second time if it fails on the first. For me, during analysis of a couple of cases, this only happens the very first time a channel is added to a volume.

While this is clearly not an ideal solution, it appears to resolve the issue and may be worth incorporating until the true cause is identified and remedied. Should I create a pull request?

gempa-jabe commented 7 years ago

@andres-h can you please take a look at the change? We often have issues with converting XML to SEED but it has rather low priority since SEED is superseded by FDSN StationXML.