This module provides read and write support for GSE2 CM6 compressed as well as GSE1 CM6/INT waveform data and header info. Most methods are based on the C library GSE_UTI of Stefan Stange, which is interfaced via Python ctypes.
copyright: | The ObsPy Development Team (devs@obspy.org) & Stefan Stange |
---|---|
license: | GNU Lesser General Public License, Version 3 (http://www.gnu.org/copyleft/lesser.html) |
Similar to reading any other waveform data format using obspy.core:
>>> from obspy import read
>>> st = read("/path/to/loc_RJOB20050831023349.z")
You can also specify the following keyword arguments that change the behavior of reading the file:
>>> st
<obspy.core.stream.Stream object at 0x...>
>>> print(st)
1 Trace(s) in Stream:
.RJOB..Z | 2005-08-31T02:33:49.850000Z - 2005-08-31T02:34:49.845000Z
| 200.0 Hz, 12000 samples
The format will be determined automatically. Each trace (multiple ‘WID2’ entries are mapped to multiple traces) will have a stats attribute containing the usual information. When reading a GSE2 file it will have one additional attribute named gse2. This attribute contains all GSE2 specific attributes:
>>> print(st[0].stats)
network:
station: RJOB
location:
channel: Z
starttime: 2005-08-31T02:33:49.850000Z
endtime: 2005-08-31T02:34:49.845000Z
sampling_rate: 200.0
delta: 0.005
npts: 12000
calib: 0.0949
_format: GSE2
gse2: AttribDict({'instype': '', 'elev': -0.999,
'datatype': 'CM6', 'hang': -1.0, 'lon': -999.0,
'edepth': -0.999, 'auxid': 'RJOB',
'vang': -1.0, 'calper': 1.0,
'lat': -99.0, 'coordsys': ''})
The actual data is stored as ndarray in the data attribute of each trace.
>>> print(st[0].data)
[ 12 -10 16 ..., 8 0 -40]