Commit 56a25fad authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

proceeding

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1956
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 9304316c
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: mseedread.cc,v 1.3 2004-07-19 07:22:02 tforb Exp $
* $Id: mseedread.cc,v 1.4 2006-01-13 10:36:39 tforb Exp $
* \author Thomas Forbriger
* \date 15/07/2004
*
......@@ -19,7 +19,7 @@
#define TF_MSEEDREAD_CC_VERSION \
"TF_MSEEDREAD_CC V1.0 "
#define TF_MSEEDREAD_CC_CVSID \
"$Id: mseedread.cc,v 1.3 2004-07-19 07:22:02 tforb Exp $"
"$Id: mseedread.cc,v 1.4 2006-01-13 10:36:39 tforb Exp $"
#include <string>
#include <datreadxx/mseedread.h>
......@@ -29,6 +29,34 @@ namespace datread {
namespace mseed {
/*! Concept of reading MiniSEED files
*
* This module is designed to read data from SeisComP an there from the
* old version used in the GRSN, where MiniSEED data files containe
* telemetry volume headers and the recent version that only contains data
* blocks.
*
* 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.
*
* We will use the basic structures defined in namespace SEED to hold the
* data. However, it will be nacessary 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).
*/
/*----------------------------------------------------------------------*/
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: seedstructs.h,v 1.2 2004-07-19 07:22:02 tforb Exp $
* $Id: seedstructs.h,v 1.3 2006-01-13 10:36:39 tforb Exp $
* \author Thomas Forbriger
* \date 16/07/2004
*
......@@ -23,7 +23,7 @@
#define TF_SEEDSTRUCTS_H_VERSION \
"TF_SEEDSTRUCTS_H V1.0 "
#define TF_SEEDSTRUCTS_H_CVSID \
"$Id: seedstructs.h,v 1.2 2004-07-19 07:22:02 tforb Exp $"
"$Id: seedstructs.h,v 1.3 2006-01-13 10:36:39 tforb Exp $"
namespace datread {
......@@ -41,6 +41,17 @@ namespace datread {
* All references refer to this manual.
*
* The structure of a data record is given in Fig. 8 in chapter 2.
*
* A useful command to investigate binary data files is
*
* od -A x -t x1z filename
*
* This dumps hex values at hex addresses and adds printable characters to
* the end of each line.
*
* This namespace should contain raw SEED structure. Any structure that
* provides additional facilities to read from a file should be placed in
* namespace mseed (an thus in a different source file).
*/
namespace SEED {
......@@ -57,6 +68,9 @@ namespace datread {
/*! a structure to hold a blockette header
*
* see chapter 3, page 34 on "How to Assemble Control Headers"
*
* This differs from the blockette header of data record blockettes.
* See DataRecordBlocketteHeader below.
*/
struct BlocketteHeader {
char type[3];
......@@ -117,7 +131,7 @@ namespace datread {
* see chapter 8, page 92.
*/
struct FixedDataRecordHeader {
ControlHeader header; //!< control header with sequence number
ControlHeader controlheader; //!< control header with sequence number
char stat[5]; //!< station identifier code
char loc[2]; //!< location identifier
char chan[3]; //!< channel identifier
......@@ -135,13 +149,19 @@ namespace datread {
unsigned short int fblock; //!< first blockette
}; // FixedDataRecordHeader
/*! s structure to hold a data record blockette header
*/
struct DataRecordBlocketteHeader {
unsigned short int type; //!< Blockette type
unsigned short int next; //!< Next blockette's byte number
}; // DataRecordBlocketteHeader
/*! a structure to hold a data only blockette
*
* [1000] Data Only SEED Blockette
*/
struct DataOnlySEEDBlockette {
unsigned short int type; //!< Blockette type (1000)
unsigned short int next; //!< Next blockette's byte number
DataRecordBlocketteHeader blocketteheader;
unsigned char format; //!< Encoding Format
unsigned char bytesex; //!< Word order
unsigned char reclen; //!< Data Record Length
......@@ -153,8 +173,7 @@ namespace datread {
* [1001] Data Extension Blockette
*/
struct DataExtensionBlockette {
unsigned short int type; //!< Blockette type (1001)
unsigned short int next; //!< Next blockette's byte number
DataRecordBlocketteHeader blocketteheader;
unsigned char tquality; //!< Timing quality
unsigned char usec; //!< microseconds
unsigned char reserved; //!< reserved
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment