DATRW++ library: seismic data I/O with multiple formats
|
all the stuff to read mini-SEED data More...
Namespaces | |
key | |
namespace for keyword string constants. | |
SEED | |
util | |
Classes | |
struct | ConsistencyCheckControl |
struct | ConsistencyChecks |
struct | Debug |
class | MiniSEEDblock |
class | MiniSEEDRecord |
struct | Record |
Functions | |
libtime::TAbsoluteTime | convert (const SEED::BTIME &t) |
convert BTIME structure to libtime structure More... | |
void | help (std::ostream &os=std::cout) |
function to print online help More... | |
bool | needswap (const unsigned char &bytesex) |
check bytesex More... | |
std::istream & | operator>> (std::istream &is, MiniSEEDblock &mb) |
std::istream & | operator>> (std::istream &is, MiniSEEDRecord &mr) |
double | samplinginterval (const short int &srate, const short int &srmult) |
calculate sampling interval from srate and smult More... | |
Variables | |
const bool | isbinary =true |
Format properties. More... | |
const char *const | streamID ="mseed" |
Format properties. More... | |
all the stuff to read mini-SEED data
This module is designed to read data from SeisComP an there from the old version used in the GRSN (with comserv client datalog) as well as the new version (using seedlink). Further it will read EDL (Earth Data Logger) MiniSEED files. Their formats differ in block size and MiniSEED data files that are written by comserv contain telemetry volume headers additionally.
If we provide a stream like class, that is constructed from an istream object and returns a full data block at once (containing fixed data header, blockette 1000 and blockette 1001 and time series samples; the latter preferably in an STL vector), we can hide all bytesex and blocksize stuff inside this class.
This stream class has to skip the telemetry volume header if the file starts with one. And it has to check the bytesex of the data, which is coded therein, but which is only available from blockette 1000, which is only available after some reading. The data record length is also only available from blockette 1000. Thus reading this informations would already require to know this information. Thus there will be some guessing and testing be involved and in particular some strong assumptions about the blockette structure used in the file. Fortunately the SEED manual defines on page 12, that the common byte order for all SEED header fields is big-endian (Motorola). Only SEED data fields my by different. Their byte order is specified in the Data Only SEED Blockette in the case of MiniSEED data.
Notice: Data written by EarthDataLoggers is not consistent with the definition of the byte order of header fields in SEED data. EDL prefer to write everything in Intel byte order :-( The code has to check for this, which is done in member function datrw::mseed::MiniSEEDRecord::readheader(std::istream& is) as well as in the test program provided in file mseedtest.cc
We will use the basic structures defined in namespace SEED to hold the data. However, it will be necessary to put some envelope around these structure in particular to indicate if a blockette was actually read from a dataset or not (because it will be present in the returned data block structure in any case).
In data streamed directly from Q330HR data acquisition systems, there may ASCII blocks be present containing system logs. This ASCII data is handled in datrw::mseed::MiniSEEDRecord::readheader(std::istream& is) which just skips the ASCII block and reads until the next binary data block. If it reaches EOF datrw::mseed::MiniSEEDRecord::Mvalid is turned to false as usual with all other reading operations.
This module is predominantly coded to extract data from a SeisComP or COMSERV system.