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 string version = "$Id: mtu2birrp.cpp 651 2006-10-10 14:46:53Z max $";
00009 
00010 /*!
00011  * \addtogroup UtilProgs Utility Programs
00012  *@{
00013  * \file
00014  * Calculate the first difference for all components of a MT time-series. 
00015  */
00016 
00017 int main (int argc, char *argv[])
00018 {
00019         string infilename;
00020         if (argc == 2)
00021         {
00022                 infilename = argv[1];
00023         }
00024         else
00025         {
00026                 cout << "This is mtufdiff: Calculate first difference of  Phoenix time series" << endl<< endl;
00027                 cout << " Usage:      mtufdiff infilename " << endl;
00028                 cout << " Ending '.fdiff'  will be automatically assigned to outfilename" << endl<< endl;
00029                 cout << " This is Version: " << version << endl << endl;
00030                 infilename = AskFilename(" Mtu-Filename: ");
00031         }
00032         
00033         
00034         TimeSeriesData Data;
00035         
00036         Data.GetData(infilename);
00037         adjacent_difference(Data.GetData().GetEx().GetData().begin(),Data.GetData().GetEx().GetData().end()
00038                 ,Data.GetData().GetEx().GetData().begin());
00039         adjacent_difference(Data.GetData().GetEy().GetData().begin(),Data.GetData().GetEy().GetData().end()
00040                 ,Data.GetData().GetEy().GetData().begin());
00041         adjacent_difference(Data.GetData().GetHx().GetData().begin(),Data.GetData().GetHx().GetData().end()
00042                 ,Data.GetData().GetHx().GetData().begin());
00043         adjacent_difference(Data.GetData().GetHy().GetData().begin(),Data.GetData().GetHy().GetData().end()
00044                 ,Data.GetData().GetHy().GetData().begin());
00045         Data.WriteAsMtu(infilename+".fdiff");
00046 }
00047 /*@}*/

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