Fellow ObsPy user and developers, I have searched the available documentation and API and was unable to find any reference to the integration of S-File Nordic format of event catalogs. Anyone knows if there is such a faculty already implemented, or if there are any plans to implement it in a near future? Thank you for your time and information, Emanuel Antunes Seismology Laboratory Instituto Superior Técnico University of Lisbon
I might be wrong on this, but I always assumed that Seisan support in Obspy is limited to the waveform format, i.e. there is no support for the nordic format at the moment. If someone did some work on this I am not aware of this.
Thank you for your reply. That is exactly what I know so far. I'm just probing the community to see if there is something I'm missing.
I wrote a small package in Mathematica to interpret S-Files for some previous work I had, and I didn't want to do the same for ObsPy, unless I have no other alternative. But that's not urgent at the moment.
I think this has previously posted this in the obspy user group. I have hacked something together that was designed to meet our needs and has been modified by many over the years. Ideally this code would be modified to output an obspy event or quakeml. I have intended to do that, but it is low on my priority list. The code is available at http://wichita.ogs.ou.edu/documents/python/
The code has been modified since being uploaded, but the basics are the same. Feel free to modify and adapt.
With repeated interest in this, it may be worth starting a github project to build something more robust and generic which could then integrate well with obspy, but also stand alone. I cannot take on the greatest extent of this effort but would be willing to help and initiate the effort.
Oklahoma Geological Survey
Several months back I modified Austin's code for my own purposes, which was to look at Seisan data from a volcano observatory and convert it to an ObsPy catalog. My version is here:
It supports things like:
# load a Seisan S-file into a Sfile object
s1 = Sfile(path)
# show the file
s1.cat() # cat(s1.path) would also work
# print the object
# export to ObsPy event object
e = s.export('obspy')
I probably wrote code to read a whole catalog at once - a wrapper around the above code - if so it is probably in this repository (I just called "volcanoObsPy" for want of a better name):
https://github.com/USF-Seismic-Lab/volcanoObsPy perhaps along a similar theme to Austin.
It includes some very rough codes for importing Antelope CSS3.0 and Seisan catalogs into the ObsPy Catalog/Event classes, re-creating some of my favourite Seisan tools, computing RSAM data etc. But it was a short effort for my own purposes only, and some time since I touched any of this.
If there is anything here that others think might be useful, let me know, though I don't know when I'll get time to take it further.
P.S. I also have importers for catalogs into MATLAB, using Catalog, Event, Origin, Arrival classes I added to my own fork of the GISMO toolbox (my fork is at https://github.com/gthompson/gismotools_alt). These classes closely follow the CSS3.0 schema.
Thank you for your reply and insight. I appreciate your gesture of sharing your code. It looks like most of the functionalities I was looking for are somewhat implemented there and the code may be tweaked to suit my purposes. Reading your code also taught me a few things. Thank you.
I apologize for my delay in replying you. Thank you very much for all the information you provided. I read the code and it pretty much does what I need it to. I just can't see the export function in https://github.com/USF-Seismic-Lab/volcanoObsPy/blob/master/Seisan_Catalog.py Unless I'm missing something, there's only this:
mag = 0.0
Thank you very much Glenn and Austin. This looks like it wouldn't be too difficult to integrate with ObsPy given the state of development.