printhdr.cpp
Go to the documentation of this file.00001 #include "SeismicDataComp.h"
00002 #include "CFatalException.h"
00003 #include <iostream>
00004 #include <string>
00005 #include "Util.h"
00006
00007 using namespace std;
00008 using namespace gplib;
00009
00010 string version = "$Id: printhdr.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
00011
00012 int main()
00013 {
00014 cout << "This is printhdr: Print sac header information" << endl;
00015 cout << " Reads in a file in SAC format and writes header data to stdout"
00016 << endl;
00017 cout
00018 << " Not all header values are displayed, only the ones supported by CSeismicDatacomp"
00019 << endl;
00020 cout << " This is Version: " << version << endl << endl;
00021
00022 string infilename = AskFilename("Input file: ");
00023
00024 SeismicDataComp Input;
00025
00026 try
00027 {
00028 Input.ReadData(infilename);
00029 } catch (FatalException &e)
00030 {
00031 cerr << e.what() << endl;
00032 return -1;
00033 }
00034 cout << "Name: " << Input.GetName() << endl;
00035 cout << "StLA: " << Input.GetStLa() << endl;
00036 cout << "StLo: " << Input.GetStLo() << endl;
00037 cout << "StEl: " << Input.GetStEl() << endl;
00038 cout << "StDp: " << Input.GetStDp() << endl;
00039 cout << "EvLa: " << Input.GetEvLa() << endl;
00040 cout << "EvLo: " << Input.GetEvLo() << endl;
00041 cout << "EvEl: " << Input.GetEvEl() << endl;
00042 cout << "EvDp: " << Input.GetEvDp() << endl;
00043 cout << "Mag: " << Input.GetMag() << endl;
00044 cout << "Dist: " << Input.GetDist() << endl;
00045 cout << "Az: " << Input.GetAz() << endl;
00046 cout << "Baz: " << Input.GetBaz() << endl;
00047 cout << "GcArc: " << Input.GetGcarc() << endl;
00048 cout << "Dt: " << Input.GetDt() << endl;
00049 cout << "B: " << Input.GetB() << endl;
00050
00051 }