using obspy-scan with Reftek data


I have a directory tree with raw data copied from a Reftek RT130. I want to make some simple plots of the data holdings for this station over monthly timescales using obspy-scan. However, that script doesn’t know how to read the Reftek data format. Has anyone worked around this, perhaps leveraging the read library?


Hi Brian,

Reftek support will be in upcoming release 1.1.0, but it's not yet in
1.0.3. So either you switch to master for now, or wait a few more days
for 1.1.0.


Thanks! I’ll wait a few days and upgrade to the newest version.

I updated obspy to the new version. Now obspy-scan recognizes the data as Reftek, but it fails with the following error:

UserWarning: Encountered some packets of types that are not implemented yet (types: [‘AD’, ‘CD’, ‘DS’, ‘FD’, ‘OM’, ‘SC’, 'SH’])

I figured it out. Turns out I had to specify wildcards for each subdirectory as follows:

obspy-scan 2017/2017*/AD10/1/*

Instead of:

obspy-scan 2017/2017*

Hi Brian,

what you showed was a warning that shows up when reading Reftek130 files
that contain packet types the are not implemented yet. Mostly that would
be special metadata on the waveforms (calibration, triggers etc), see
the included manual if you're interested in details ("Packet
Description", pg. 7 and following):

However, even if the warning shows, obspy-scan should still not error
out but continue. Let me know if it doesn't.

So the catch all wildcard should still work (even if it might show lots
of warnings). But yes, if those warnings annoy you, just running on the
data subfolder ".../1/" is probably a good idea. On the other hand if
you're scared of missing data with too specific wildcards during the
reading you could suppress those warning messages by doing the scan in a
tiny python script like:

import warnings
from obspy.imaging.scripts.scan import scan

with warnings.catch_warnings():
        action='ignore', message=r'No event trailer \(ET\) packets',
        message='Encountered some packets of types that are not '
                'implemented yet',
    scan(paths=['/path/to/your/data'], plot=True)


Hi Tobias,

Thanks for the tips. I tried to make day plots from files taken off the Reftek, but it failed with an error that reads: ValueError: All traces need to be of the same id for a dayplot

from obspy import read
st = read("2017/2017231/AD10/1/*”)


If I remove the type="dayplot” part, it successfully plots a normal time series with no errors.

According to the source code for obspy.imaging.waveform, the ValueError refers to len( != 1. Do I need to merge the packet files somehow before trying to plot?


Hi Brian,

according to the error message you get, you have more than one SEED ID
in the data you read. I would suspect that you have all three (or even
more) components in there, since Reftek stores them next to each other
in the same directory. You probably just want to select the "Z"
component (or one of the horizontals). Since you didn't specify
'component_codes' to 'read()' (see
docs), you likely have components '0', '1', '2'. So something like this
should work.. (depends on you sensor/setup, but usually first channel
'0' should be Z)

from obspy import read
st = read("2017/2017231/AD10/1/*”)'0').plot(type="dayplot")


That’s the trick I was missing. Now it works. Thanks!