GPLIB++
MtuFormat.h
Go to the documentation of this file.
1 #ifndef _MTUFORMAT_INCLUDED_
2 #define _MTUFORMAT_INCLUDED_
3 #include "TimeSeries.h"
4 
5 #include <string>
6 #include <fstream>
7 namespace gplib
8  {
9  /** \addtogroup mttools MT data analysis, processing and inversion */
10  /* @{ */
11 
12  //! Read and write phoenix mtu binary files
13  class MtuFormat: public TimeSeries
14  {
15  private:
16  char startsec;
17  char startmin;
18  char starthr;
19  char startday;
20  char startmonth;
21  char startyear;
22  char startdow;
23  char startcentury;
24  int serialnumber;
25  int nscans;
26  char nchannels;
27  char taglength;
28  char status;
29  char saturationflags;
30  char futurereserved;
31  double sampledenom;
32  double sampleenum;
33  char sampleunit;
34  char samplelength;
35  char rateunit;
36  char clockstatus;
37  int clockerror;
38  char reserved[6];
39  //! Read one record of data (header+data) from the filestream
40  void ReadRecord(std::ifstream &infile);
41  //! Write a number to file in mtu binary format
42  void WriteNum(double number, std::ofstream &outfile);
43  //! Convert raw bytes from mtu binary file to integer number
44  int ByteToInt(unsigned char first, unsigned char second,
45  unsigned char last);
46  //! Convert byte sequence to a number and append to channel
47  void ReadValue(TimeSeriesComponent &CurrChannel, char *pos);
48  //! Set time information in header
49  void UpDateHeader(unsigned char *&header, const int firstscan);
50  public:
51  //! remove the "bad" flag from the header
52  void MakeGood();
53  MtuFormat();
54  virtual ~MtuFormat();
55  virtual void GetData(const std::string filename);
56  virtual void GetData();
57  virtual void WriteData(const std::string filename);
58  MtuFormat& operator=(MtuFormat &source);
59  MtuFormat& operator=(TimeSeries &source);
60  };
61  /* @} */
62  }
63 #endif
MtuFormat & operator=(MtuFormat &source)
Definition: MtuFormat.cpp:248
void MakeGood()
remove the "bad" flag from the header
Definition: MtuFormat.cpp:158
This class is the base class for all classes dealing with MT time series.
Definition: TimeSeries.h:14
TimeSeriesComponent is the base storage class for all types of time series data.
virtual void WriteData(const std::string filename)
Definition: MtuFormat.cpp:200
virtual ~MtuFormat()
Definition: MtuFormat.cpp:19
virtual void GetData()
Definition: MtuFormat.cpp:153
Read and write phoenix mtu binary files.
Definition: MtuFormat.h:13