Search code examples
pythonstructureobspy

Obspy, reading files from SDS file structure


I am using the obspy module to read miniseed files from a local SDS file structure into an obspy stream object. I have organised my files into a local SDS file structure according to the SeisComP formatting instructions, initialised the obspy client and used the client.get_waveforms function, but the returned stream object is empty. I don't get any errors in python for the part of my code dealing with the file import.

Here is an example of my file structure, which represents YEAR-2011, Day-315, Network-OZLLOC1, Station-6F20, Location-B, Channel-E, Type-D:

"SDS_root" / 2011 / OZLLOC1 / 6F20 / E.D / OZLLOC1.6F20.B.E.D.2011.022.msd

any my file import code:

import Tkinter, tkFileDialog
from obspy.core import UTCDateTime
from obspy.clients.filesystem.sds import Client

root = Tkinter.Tk()
root.withdraw()
SDS_root = tkFileDialog.askdirectory(initialdir=os.getcwd(), parent=root,
                                     title='Browse to SDS root dir')

client = Client(SDS_root, sds_type='D', format='*')
t = UTCDateTime("2011-11-22T00")
st = client.get_waveforms('OZLLOC1', '*', '*', '*', t, t+20, merge=-1)

print(st)
return st

The print statement gives "0 Trace(s) in Stream:"

As you can see, I've used wildcards extensively in order to cast a wide net over my files, but still, nothing gets read into the stream (st variable). Has anyone had experience with the reading from SDS with obspy, or can spot my issue?


Solution

  • SDS structure has no .msd file endings.

    For whatever reason I cannot post multiple links in this answer so please see all details on our github issue tracker, which is the right place for ObsPy related questions anyway: https://github.com/obspy/obspy/issues/1378