swapphase.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 #include <iterator>
00003 #include "MTStationList.h"
00004 #include "Util.h"
00005 
00006 using namespace std;
00007 using namespace gplib;
00008 
00009 /*!
00010  * \addtogroup UtilProgs Utility Programs
00011  *@{
00012  * \file
00013  * Swap the phase of the impedance by 180 degrees. This is useful
00014  * when the responses assume a different time dependeny for the harmonic
00015  * fields.
00016  */
00017 
00018 int main()
00019   {
00020     MTStationList MTSites;
00021 
00022     cout << " Swap all phases by 180 degrees." << endl;
00023     string infilename = AskFilename("Input Filename: ");
00024     MTSites.GetData(infilename);
00025     for (unsigned int i = 0; i < MTSites.GetList().size(); ++i)
00026       {
00027         cout << "Working on  site " << MTSites.GetList().at(i).GetName();
00028         for (unsigned int j = 0; j < MTSites.GetList().at(i).GetMTData().size(); ++j)
00029           {
00030             MTSites.GetList().at(i).SetMTData().at(j).SetZxx() *= -1.0;
00031             MTSites.GetList().at(i).SetMTData().at(j).SetZxy() *= -1.0;
00032             MTSites.GetList().at(i).SetMTData().at(j).SetZyx() *= -1.0;
00033             MTSites.GetList().at(i).SetMTData().at(j).SetZyy() *= -1.0;
00034           }
00035         MTSites.at(i).WriteAsJ(MTSites.GetList().at(i).GetName());
00036         cout << "    ... done" << endl;
00037       }
00038   }
00039 /*@}*/

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