Hi all,
the ObsPy master (and as a consequence the next ObsPy version) can
already read compressed G�ralp files:
In [2]: obspy.read("./20130106_1200n.gcf")
Out[2]:
13 Trace(s) in Stream:
.BJNR..HHN | 2013-01-06T12:00:00 ... | 200.0 Hz, 26600 samples
.BJNR..HHN | 2013-01-06T12:02:15 ... | 200.0 Hz, 42000 samples
.BJNR..HHN | 2013-01-06T12:05:47 ... | 200.0 Hz, 110800 samples
.BJNR..HHN | 2013-01-06T12:15:03 ... | 200.0 Hz, 42000 samples
.BJNR..HHN | 2013-01-06T12:18:35 ... | 200.0 Hz, 8400 samples
.BJNR..HHN | 2013-01-06T12:19:19 ... | 200.0 Hz, 25400 samples
.BJNR..HHN | 2013-01-06T12:21:47 ... | 200.0 Hz, 12400 samples
.BJNR..HHN | 2013-01-06T12:22:51 ... | 200.0 Hz, 8400 samples
.BJNR..HHN | 2013-01-06T12:23:35 ... | 200.0 Hz, 93200 samples
.BJNR..HHN | 2013-01-06T12:31:23 ... | 200.0 Hz, 204400 samples
.BJNR..HHN | 2013-01-06T12:48:27 ... | 200.0 Hz, 8400 samples
.BJNR..HHN | 2013-01-06T12:49:11 ... | 200.0 Hz, 102000 samples
.BJNR..HHN | 2013-01-06T12:57:42 ... | 200.0 Hz, 27600 samples
Doc: obspy.io.gcf - Guralp Compressed Format, GCF, read and write support for ObsPy — ObsPy 1.4.0.post0+326.gdfb021350c.obspy.master documentation
PR: https://github.com/obspy/obspy/pull/1449
Github: obspy/obspy/io/gcf at master · obspy/obspy · GitHub
I wrote a module that can read gcf files into obspy but haven't uploaded
to github. I've used it extensively but it should still be tested. There
are some subtleties that you can gain control over by using this library
and not a conversion tool. It is easier to diagnose problematic GCF files.
I will create a pull request as soon as I can.
We are of course always interested in things that improve or enhance
ObsPy so maybe check if your module has something that ObsPy does not
yet have?
In the long (long long) term run I would like to contribute the
read/write capability to obspy, but that is not likely to happen in
the near future. Further there are certain aspects that first needs
to be figured out, perhaps some of the obspy authors will tune in on
this thread and can give me some feedback directly, among the
questions I have are
Same comment as above.
* can C-extension modules be added to obspy?
I assume you mean a C-extension that uses the CPython C API? In
principle yes as ObsPy does already require a C compiler. Practically we
currently don't link against libpython and just compile all C parts that
we have as shared libraries and call them with ctypes. That is also
quite a bit easier.
But if someone comes along with an actual C extension we can definitely
have a look and see if it entails any installation and distribution
problems or not.
* Guralp does not carry information about network and station and
only limited information on the instrument type (I may be wrong on
this last point) how would this best be handled
Just leave them empty - there are already a couple file formats that do
this. But the gcf module in ObsPy does read a station code - did you
mean location code?
* Guralp saves information about the sampling rate in an unsigned
short (8 bit). Therefore only a limited number of sampling rates
below 1 Hz and above 255 Hz are allowed and translated into numbers
that can be handled by the format but deemed unlikely to be reel
sampling rates. Any suggestion son how this would best be handled?
This only matters for writing to GCF (which ObsPy currently cannot do so
that would be nice to have). If the sampling rate as would be written to
the GCF file is very different from the one in the Trace, just raise a
descriptive error message explaining the problem. There is really
nothing else that can be done there.
Cheers!
Lion