10 #include <boost/bind.hpp>
13 using namespace gplib;
15 string version =
"$Id: mtura.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
24 int main(
int argc,
char *argv[])
27 cout <<
"This is mtura: Calculate a running average of MT time series"
29 cout <<
" Usage: mtura infilename " << endl;
30 cout <<
" Ending '.ra' will be automatically assigned to outfilename"
32 cout <<
" This is Version: " <<
version << endl << endl;
40 infilename = AskFilename(
" Mtu-Filename: ");
48 cout <<
"Window length: ";
55 WindowTS.
GetData().assign(tslength, 0.0);
56 const size_t windowstart = 0;
58 fill_n(WindowTS.
GetData().begin() + windowstart, windowlength, 1.0);
61 WindowTS.
GetData().begin() + windowstart + windowlength,
65 transform(WindowTS.
GetData().begin() + windowstart,
66 WindowTS.
GetData().begin() + windowstart + windowlength,
67 WindowTS.
GetData().begin() + windowstart, boost::bind(
68 multiplies<double> (), _1, 1. /
double(windowlength)));
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()
void SubMean(InputIterator begin, InputIterator end, typename std::iterator_traits< InputIterator >::value_type mean)
Substract the mean from each element in the container, mean is passed as a parameter.
TimeSeriesComponent & GetHy()
TimeSeriesComponent is the base storage class for all types of time series data.
void WriteBack(std::string filename_base)
Write in the format it was originally read in.
TimeSeriesData stores a pointer to the different components of magnetotelluric data and provides func...
This functor returns the weighting factor for the Hanning window, given the relative position (0...
TimeSeriesComponent & GetEy()
TimeSeriesComponent & GetHz()
TimeSeriesComponent & GetHx()
Access function for Hx, returns reference for efficiency.