keepcommon.cpp

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

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