mtu2birrp.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 #include <string>
00003 #include "Util.h"
00004 #include "TimeSeriesData.h"
00005 #include "CFatalException.h"
00006 
00007 using namespace std;
00008 
00009 string version = "$Id: mtu2birrp.cpp 1672 2008-04-03 15:03:35Z mmoorkamp $";
00010 
00011 /*!
00012  * \addtogroup UtilProgs Utility Programs
00013  *@{
00014  * \file
00015  * Converts MTU-Format and other MT data into Birrp Ascii format for processing with the birrp code 
00016  * (basically just 5 ascii columns with the data).  
00017  */
00018 
00019 void WriteInfoAndAsk(string &infilename, string &outfilename)
00020   {
00021     cout << "This is mtu2birrp: Convert Phoenix time series to birrp-ascii"
00022         << endl<< endl;
00023     cout << "Usage: mtu2birrp infilename outfilename" << endl;
00024     cout << "Ending .asc will be automatically assigned to outfilename" << endl
00025         << endl;
00026     cout << "This is Version: " << version << endl << endl;
00027     infilename = AskFilename("Input Filename: ");
00028     cout << "Birrp-Ascii-Filename without extension: ";
00029     cin >> outfilename;
00030   }
00031 int main(int argc, char *argv[])
00032   {
00033     string infilename, outfilename;
00034     switch (argc)
00035       {
00036     case 2:
00037       infilename = argv[1];
00038       outfilename = argv[1];
00039       break;
00040     case 3:
00041       infilename = argv[1];
00042       outfilename = argv[2];
00043       break;
00044     default:
00045       WriteInfoAndAsk(infilename, outfilename);
00046       break;
00047       }
00048 
00049 
00050     TimeSeriesData Data;
00051     try
00052       {
00053         Data.GetData(infilename);
00054         Data.WriteAsBirrp(outfilename);
00055       }
00056     catch(const CFatalException &e)
00057       {
00058         cerr << e.what() << endl;
00059       }
00060   }
00061 /*@}*/

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