9 int main(
int argc,
char* argv[])
12 string listfilename, outfilename;
14 string version =
"$Id: selectsites.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
16 cout <<
"Program " << version << endl;
17 cout <<
" Select sites from a given backazimuth and distance range" << endl;
18 cout <<
" Writes out a file with site names for further processing" << endl;
23 listfilename = argv[1];
24 outfilename = argv[2];
28 cout <<
"List filename: ";
30 cout <<
"Output filename: ";
39 double maxgcarc = 130;
41 cout <<
"Minimum Backazimuth: ";
43 cout <<
" Maximum Backazimuth: ";
45 cout <<
"Minimum GcArc: ";
47 cout <<
" Maximum GcArc: ";
50 ofstream outlist(outfilename.c_str());
52 for (SeismicStationList::tseiscompvector::iterator CurrentStation =
53 Stations.
GetList().begin(); CurrentStation != Stations.
GetList().end(); CurrentStation++)
56 cout <<
"Baz: " << CurrentStation->get()->GetBaz() <<
" Gcarc: "
57 << CurrentStation->get()->GetGcarc();
59 if (minbaz <= CurrentStation->
get()->GetBaz() && maxbaz
60 >= CurrentStation->get()->GetBaz() && mingcarc
61 <= CurrentStation->get()->GetGcarc() && maxgcarc
62 >= CurrentStation->get()->GetGcarc())
64 outlist << CurrentStation->get()->GetName() << endl;
65 cout <<
" Selected ! ";
tseiscompvector & GetList()
Return the content of the list for manipulation.
Manages a collection of seismic traces, mainly provides functionality to read in data specified in a ...
void ReadList(const std::string filename)
read in a file with names and optionally coordinates
int main(int argc, char *argv[])