Converting Reftek130 files to CSS 3.0 data format

I would greatly appreciate example snippet(s) of code demonstrating the conversion of reftek130 type files to the CSS 3.0 format. I have searched the help documentation but was not able to find such information.

1 Like

Are you able to read the RT130 files into a Stream instance? If so, writing the Traces to CSS should be like writing anything else. What have you tried, and what happened?

Hello Jonathan,

Yes I am able to read RT130 files.
I noticed in the library documentation that there is the function defined as:
obspy.io.css.station._write_css
Does this mean one can write to a css data structure? If so I was hoping to find example code or additional documentation.

The code you mentioned is for writing station data from an Inventory, I think. You’re writing waveforms, yes? If so, I don’t see a plugin to write waveforms, unfortunately. I assumed there was in my comments above; my apologies.

I think the reason one doesn’t already exist may be that CSS wants to know things like the directory, file name, byte offset, and dtype of the waveform you’re writing, some of which can be decided by the user at write-time. This makes it slightly difficult for the waveform writing plug-in to manage, as it depends on external user code. Since the user is writing external code anyway, it’s not much more to ask that they just write the CSS table themselves. With reasonable defaults, though, a waveform writer plugin for CSS should be possible. I’ve started an Issue to keep track of this.