10 string version =
"$Id: exchangecomp.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
12 int main(
int argc,
char *argv[])
16 string mtufilename, compfilename;
18 <<
"This is exchangecomp: Exchange one component of MTU file by contents of ascii file"
21 <<
" Output will have the same name as MTU Input with '.rep' appended "
23 cout <<
" This is Version: " <<
version << endl << endl;
25 cout <<
"Mtu filename: ";
29 cout <<
"Component filename: ";
31 vector<double> compdata;
32 ifstream compfile(compfilename.c_str());
33 copy(istream_iterator<double> (compfile), istream_iterator<double> (),
34 back_inserter(compdata));
37 std::cerr <<
"Number of points incompatible !";
41 cout <<
"Enter target component number (Ex,Ey,Hx,Hy): ";
43 std::vector<double>::iterator outit;
59 std::cerr <<
"Invalid component selection !";
63 copy(compdata.begin(), compdata.end(), outit);
std::vector< double > & GetData()
Access for data vector, for ease of use and efficiency we return a reference.
TimeSeries & GetData()
return a reference to the actual object stored in the pointer
TimeSeriesComponent & GetEx()
int main(int argc, char *argv[])
TimeSeriesComponent & GetHy()
void WriteAsMtu(std::string filename_base)
Write data to file in Phoenix MTU format.
TimeSeriesData stores a pointer to the different components of magnetotelluric data and provides func...
TimeSeriesComponent & GetEy()
TimeSeriesComponent & GetHx()
Access function for Hx, returns reference for efficiency.