obspy.io.sh.core._read_q

_read_q(filename, headonly=False, data_directory=None, byteorder='=', **kwargs)[source]

Reads a Seismic Handler Q file and returns an ObsPy Stream object.

Warning

This function should NOT be called directly, it registers via the ObsPy read() function, call this instead.

Parameters:
  • filename (str) – Q header file to be read. Must have a QHD file extension.

  • headonly (bool, optional) – If set to True, read only the head. This is most useful for scanning available data in huge (temporary) data sets.

  • data_directory (str, optional) – Data directory where the corresponding QBN file can be found.

  • byteorder (str, optional) – Enforce byte order for data file. This is important for Q files written in older versions of Seismic Handler, which don’t explicit state the BYTEORDER flag within the header file. Can be little endian ('<'), big endian ('>'), or native byte order ('='). Defaults to '='.

Return type:

Stream

Returns:

A ObsPy Stream object.

Q files consists of two files per data set:

  • a ASCII header file with file extension QHD and the

  • binary data file with file extension QBN.

The read method only accepts header files for the filename parameter. ObsPy assumes that the corresponding data file is within the same directory if the data_directory parameter is not set. Otherwise it will search in the given data_directory for a file with the QBN file extension. This function should NOT be called directly, it registers via the ObsPy read() function, call this instead.

Example

>>> from obspy import read
>>> st = read("/path/to/QFILE-TEST.QHD")
>>> st    
<obspy.core.stream.Stream object at 0x...>
>>> print(st)  
3 Trace(s) in Stream:
.TEST..BHN | 2009-10-01T12:46:01.000000Z - ... | 20.0 Hz, 801 samples
.TEST..BHE | 2009-10-01T12:46:01.000000Z - ... | 20.0 Hz, 801 samples
.WET..HHZ  | 2010-01-01T01:01:05.999000Z - ... | 100.0 Hz, 4001 samples