2 #include "CFatalException.h"
10 using namespace gplib;
12 string version =
"$Id: diffangle.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
23 cerr << e.what() << endl;
30 cout << prompt << endl << endl;
33 for (trealdata::const_iterator frequencies =
37 cout << setw(9) << setfill(
' ') << setprecision(4) << distance(
39 cout << setw(15) << setfill(
' ') << setprecision(8) << 1.
40 / (*frequencies) << endl;
43 cout <<
"Select frequency Index: ";
52 <<
" This is diffangle, calculate the difference in strike angle and phase split"
54 cout <<
" for corresponding sites in two different lists. " << endl << endl;
66 ofstream outfile(
"out");
67 const int nbootsamples = 10000;
68 CJacknife ErrEst(nbootsamples);
69 for (
size_t i = 0; i < StatSync.size(); ++i)
72 double strikediff = (StatSync.at(i).first->GetMTData().at(
74 - StatSync.at(i).second->GetMTData().at(freqindices2.at(i).at(
76 double strikeerr, dummy;
78 StatSync.at(i).first->GetMTData().at(freqindices1.at(i).at(
79 SelectedFreq1)), dummy, strikeerr);
80 double phidiffdiff = (StatSync.at(i).first->GetMTData().at(
81 freqindices1.at(i).at(SelectedFreq1)).GetBeta_phi()
82 - StatSync.at(i).second->GetMTData().at(freqindices2.at(i).at(
83 SelectedFreq2)).GetBeta_phi());
85 ErrEst.CalcErrors(&MTTensor::GetBeta_phi,
86 StatSync.at(i).first->GetMTData().at(freqindices1.at(i).at(
87 SelectedFreq1)), dummy, phidifferr);
88 outfile << phidiffdiff * 180. / PI <<
" " << strikediff <<
" "
89 << phidifferr * 180. / PI <<
" " << strikeerr << endl;
int PromptAndReadFreqIndex(MTStationList &List, std::string prompt)
const trealdata & GetCommonFrequencies()
Get a vector with frequencies that are common to all sites.
MTStationList holds a number of MTSites, usually associated with a single project, line, etc.
tStationList & GetList()
Access to the complete vector of Stations.
void PromptAndReadStationFile(MTStationList &List, std::string prompt)
const std::vector< tindexvector > & GetComFreqIndices()
Get a vector that for each site contains the indices to the common frequencies.
void GetData(const std::string filename)
Read a list of filenames and the associated data in those files to fill the list. ...
The basic exception class for all errors that arise in gplib.