datarec_multi.cpp

Go to the documentation of this file.
00001 #include "CalcRecConf.h"
00002 #include "SeismicStationList.h"
00003 #include "FatalException.h"
00004 #include "MultiRecCalc.h"
00005 #include "Util.h"
00006 #include <iostream>
00007 #include <fstream>
00008 #include <string>
00009 #include <vector>
00010 
00011 using namespace std;
00012 using namespace gplib;
00013 
00014 string version = "$Id: datarec_multi.cpp 1839 2010-03-05 17:04:34Z mmoorkamp $";
00015 
00016 int main()
00017   {
00018     cout
00019         << " This is datarec_multi: Calculate receiver functions simultaneously for several events"
00020         << endl; // write some info
00021     cout
00022         << " Reads in two lists of files with radial and vertical component file names, respectively"
00023         << endl;
00024     cout << " Outputs a file multi.rec " << endl;
00025     cout << " Some behaviour can be configured with the file calcrec.conf"
00026         << endl;
00027     cout << " This is Version: " << version << endl << endl;
00028 
00029     CalcRecConf Config;
00030     SeismicDataComp CurrRadial, CurrVertical;
00031     SeismicStationList Radial, Vertical;
00032     string outfilename = "multi.rec";
00033     try
00034       {
00035         Config.GetData("calcrec.conf");
00036         std::string radlistname = AskFilename(
00037             "File with list of radial filenames: ");
00038         std::string verlistname = AskFilename(
00039             "File with list of vertical filenames: ");
00040 
00041         Radial.ReadList(radlistname);
00042         Vertical.ReadList(verlistname);
00043 
00044         MultiRecCalc Receiver(Config.shift, Config.sigma, Config.cc);
00045         SeismicDataComp RecFunc;
00046         Receiver.CalcRecData(Radial.GetList(), Vertical.GetList(), RecFunc);
00047 
00048         RecFunc.WriteAsSac(outfilename);
00049       } catch (FatalException &e)
00050       {
00051         cerr << e.what() << endl; // if something fails print error
00052         return -1; // and stop execution
00053       }
00054   }

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