keepcommon.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 #include <vector>
00003 #include "MTStationList.h"
00004 #include "Util.h"
00005 using namespace std;
00006 using namespace gplib;
00007 
00008 int main()
00009   {
00010     try
00011       {
00012         MTStationList MTSites;
00013         std::string infilename = AskFilename("Station Filename: ");
00014 
00015         MTSites.GetData(infilename);
00016         const unsigned int nstats = MTSites.GetList().size();
00017 
00018         for (unsigned int i = 0; i < nstats; ++i)
00019           {
00020             trealdata freqs(MTSites.at(i).GetFrequencies());
00021             const int nfreq = MTSites.at(i).GetFrequencies().size();
00022             for (int j = 0; j < nfreq; ++j)
00023               {
00024                 if (find(MTSites.GetComFreqIndices().at(i).begin(),
00025                     MTSites.GetComFreqIndices().at(i).end(), j)
00026                     == MTSites.GetComFreqIndices().at(i).end())
00027                   freqs.at(j) = 0;
00028               }
00029             MTSites.at(i).SetFrequencies(freqs);
00030             MTSites.at(i).WriteAsMtt(MTSites.at(i).GetName());
00031           }
00032       } catch (FatalException &e)
00033       {
00034         cerr << e.what() << endl;
00035         return -1;
00036       }
00037   }
00038 

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