any plans to add a FULL SEED reader to obspy

Hi All,

The subject says it all. Are there any plans to add full seed reading capability to ObsPy? Or maybe it's already there and I missed it in the docs?

Cheers,

Paul

Hi Paul,

both, the data and the metadata part can be read, although separately:

Reading data:
>>> import obspy
>>> st = obspy.read("full_seed_file")

Reading the metadata:
>>> from obspy.xseed import Parser
>>> p = Parser("full_seed_file")

All the best!

Lion

Greatings Lion,

Thanks, however a waveform read for the full seed volume obtained from the DMC as a test just now did not seem to work at all (with the obspy tar.gz I downloaded last week).

pauls-MacBook-Air-2:induced paulf$ python2.7
Python 2.7.3 (default, Oct 22 2012, 06:12:32)
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import obspy.core
>>> st = read('Ohio_events_Nov3-.86526.seed')
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
NameError: name 'read' is not defined
>>> st = obspy.core.read('events_nov3-.86526.seed')
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy-0.0.0_tar_zipball-py2.7-macosx-10.7-x86_64.egg/obspy/core/stream.py", line 247, in read
     st.extend(_read(file, format, headonly, **kwargs).traces)
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy-0.0.0_tar_zipball-py2.7-macosx-10.7-x86_64.egg/obspy/core/util/decorator.py", line 151, in wrapped_func
     result = func(filename, *args, **kwargs)
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy-0.0.0_tar_zipball-py2.7-macosx-10.7-x86_64.egg/obspy/core/stream.py", line 288, in _read
     headonly=headonly, **kwargs)
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy-0.0.0_tar_zipball-py2.7-macosx-10.7-x86_64.egg/obspy/core/util/base.py", line 413, in _readFromPlugin
     list_obj = readFormat(filename, **kwargs)
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy-0.0.0_tar_zipball-py2.7-macosx-10.7-x86_64.egg/obspy/mseed/core.py", line 178, in readMSEED
     info = util.getRecordInformation(mseed_object)
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy-0.0.0_tar_zipball-py2.7-macosx-10.7-x86_64.egg/obspy/mseed/util.py", line 245, in getRecordInformation
     info = _getRecordInformation(f, offset=offset)
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy-0.0.0_tar_zipball-py2.7-macosx-10.7-x86_64.egg/obspy/mseed/util.py", line 305, in _getRecordInformation
     while file_object.read(7)[6] != 'D':
IndexError: string index out of range
>>>

Lion Krischer wrote:

Hi Paul,

interesting. Can you send me the file? It works just fine when using one of the files from the ObsPy example data page:

In [1]: import obspy

In [2]: print obspy.read("http://examples.obspy.org/fullseed_EE_VSU")
3 Trace(s) in Stream:
EE.VSU..BHE | 2010-02-06T04:52:17.645000Z - 2010-02-06T05:05:40.745000Z

20.0 Hz, 16063 samples

EE.VSU..BHN | 2010-02-06T04:52:13.695000Z - 2010-02-06T05:05:30.195000Z

20.0 Hz, 15931 samples

EE.VSU..BHZ | 2010-02-06T04:52:10.645000Z - 2010-02-06T05:05:35.745000Z

20.0 Hz, 16103 samples

Thanks!

Lion

Thanks for the file!

That was actually quite a serious bug. For the last couple of releases ObsPy was not able to read fullSEED files whose first data record does not have dataquality "D"...I have no idea why the issue did not crop up before.

It is fixed in the latest master, the relevant commit: https://github.com/obspy/obspy/commit/1e30bb74a962c1718c9f37dc963d490e5c110692

If you do not which to update your whole ObsPy installation you can simply change the single line as indicated by the previous url. To find the offending file, simply type

import obspy.mseed.util; print obspy.mseed.util.__file__

at any Python prompt and it should print the file's location (replace .pyc with .py).

Cheers!

Lion