mtufdiff.cpp
Go to the documentation of this file.00001 #include <iostream>
00002 #include <string>
00003 #include <numeric>
00004 #include "Util.h"
00005 #include "TimeSeriesData.h"
00006
00007 using namespace std;
00008 using namespace gplib;
00009 string version = "$Id: mtu2birrp.cpp 651 2006-10-10 14:46:53Z max $";
00010
00011
00012
00013
00014
00015
00016
00017
00018 int main(int argc, char *argv[])
00019 {
00020 string infilename;
00021 if (argc == 2)
00022 {
00023 infilename = argv[1];
00024 }
00025 else
00026 {
00027 cout
00028 << "This is mtufdiff: Calculate first difference of Phoenix time series"
00029 << endl << endl;
00030 cout << " Usage: mtufdiff infilename " << endl;
00031 cout
00032 << " Ending '.fdiff' will be automatically assigned to outfilename"
00033 << endl << endl;
00034 cout << " This is Version: " << version << endl << endl;
00035 infilename = AskFilename(" Mtu-Filename: ");
00036 }
00037
00038 TimeSeriesData Data;
00039
00040 Data.GetData(infilename);
00041 adjacent_difference(Data.GetData().GetEx().GetData().begin(),
00042 Data.GetData().GetEx().GetData().end(),
00043 Data.GetData().GetEx().GetData().begin());
00044 adjacent_difference(Data.GetData().GetEy().GetData().begin(),
00045 Data.GetData().GetEy().GetData().end(),
00046 Data.GetData().GetEy().GetData().begin());
00047 adjacent_difference(Data.GetData().GetHx().GetData().begin(),
00048 Data.GetData().GetHx().GetData().end(),
00049 Data.GetData().GetHx().GetData().begin());
00050 adjacent_difference(Data.GetData().GetHy().GetData().begin(),
00051 Data.GetData().GetHy().GetData().end(),
00052 Data.GetData().GetHy().GetData().begin());
00053 Data.WriteAsMtu(infilename + ".fdiff");
00054 }
00055