10 using namespace gplib;
12 string version =
"$Id: rotts.cpp 1844 2010-04-12 11:34:25Z mmoorkamp $";
21 int main(
int argc,
char *argv[])
25 cout <<
"This is rotts: Rotate time series to a 0 mean By component"
27 cout <<
" Usage: rotts filename1" << endl;
29 <<
" The output files will have the same name as the input files + .rot "
31 cout <<
" This is Version: " <<
version << endl << endl;
38 infilename = AskFilename(
"Input Filename: ");
41 cout <<
"Rotating ... " << endl;
51 cout <<
"Hy Median before: " << hymedian << endl;
53 double phi = hymedian / sqrt(std::pow(hxmedian, 2) + std::pow(hymedian, 2));
54 cout <<
"Estimated angle: " << phi << endl;
56 double sinphi = sin(-phi);
57 double cosphi = cos(-phi);
59 for (
unsigned int i = 0; i < ndata; ++i)
70 cout <<
"Hy Median after: " << hymedian << endl;
74 cerr << e.what() << endl;
76 cout <<
"... done " << endl;
std::iterator_traits< InputIterator >::value_type Median(InputIterator begin, InputIterator end)
Calculate the median for a vector style container.
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 & GetHy()
void WriteAsBirrp(std::string filename_base)
Write data to file in ascii format for birrp processing.
TimeSeriesData stores a pointer to the different components of magnetotelluric data and provides func...
The basic exception class for all errors that arise in gplib.
TimeSeriesComponent & GetHx()
Access function for Hx, returns reference for efficiency.