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

Generated on Fri Jul 4 15:30:21 2008 for GPLIB++ by  doxygen 1.5.5