MtuFormat.h

Go to the documentation of this file.
00001 #ifndef _MTUFORMAT_INCLUDED_
00002 #define _MTUFORMAT_INCLUDED_
00003 #include "TimeSeries.h"
00004 
00005 #include <string>
00006 #include <fstream>
00007 namespace gplib
00008   {
00009     /** \addtogroup mttools MT data analysis, processing and inversion */
00010     /* @{ */
00011 
00012     //! Read and write phoenix mtu binary files
00013     class MtuFormat: public TimeSeries
00014       {
00015     private:
00016       char startsec;
00017       char startmin;
00018       char starthr;
00019       char startday;
00020       char startmonth;
00021       char startyear;
00022       char startdow;
00023       char startcentury;
00024       int serialnumber;
00025       int nscans;
00026       char nchannels;
00027       char taglength;
00028       char status;
00029       char saturationflags;
00030       char futurereserved;
00031       double sampledenom;
00032       double sampleenum;
00033       char sampleunit;
00034       char samplelength;
00035       char rateunit;
00036       char clockstatus;
00037       int clockerror;
00038       char reserved[6];
00039       //! Read one record of data (header+data) from the filestream
00040       void ReadRecord(std::ifstream &infile);
00041       //! Write a number to file in mtu binary format
00042       void WriteNum(double number, std::ofstream &outfile);
00043       //! Convert raw bytes from mtu binary file to integer number
00044       int ByteToInt(unsigned char first, unsigned char second,
00045           unsigned char last);
00046       //! Convert byte sequence to a number and append to channel
00047       void ReadValue(TimeSeriesComponent &CurrChannel, char *pos);
00048       //! Set time information in header
00049       void UpDateHeader(unsigned char *&header, const int firstscan);
00050     public:
00051       //! remove the "bad" flag from the header
00052       void MakeGood();
00053       MtuFormat();
00054       virtual ~MtuFormat();
00055       virtual void GetData(const std::string filename);
00056       virtual void GetData();
00057       virtual void WriteData(const std::string filename);
00058       MtuFormat& operator=(MtuFormat &source);
00059       MtuFormat& operator=(TimeSeries &source);
00060       };
00061   /* @} */
00062   }
00063 #endif

Generated on Tue May 4 16:52:14 2010 for GPLIB++ by  doxygen 1.5.8