6 #include <boost/shared_ptr.hpp>
7 #include <boost/date_time/posix_time/posix_time.hpp>
13 using namespace gplib;
15 string version =
"$Id: mtuadaptive.cpp 942 2007-04-08 16:13:01Z max $";
20 <<
"This is tscross: Calculate the 0 lag cross-correlation between components of two times series"
22 cout <<
" The program will ask for reference and input filename. " << endl;
24 <<
" The cross correlation for each component is written to the screen."
26 cout <<
" This is Version: " <<
version << endl << endl;
31 string data1filename, data2filename;
33 data1filename = AskFilename(
"Data file 1: ");
35 cout <<
"Component Index (Hx,Hy,Ex,Ey): ";
37 data2filename = AskFilename(
"Data file 2: ");
39 cout <<
"Data1 Start time: " << Data1.
GetData().
GetTime().front() << endl;
40 cout <<
"Dat2 Start time: " << Data2.
GetData().
GetTime().front() << endl;
43 cerr <<
"Time series not synchronized !" << endl;
49 cout <<
"Input End time: " << Data1.
GetData().
GetTime().back() << endl;
50 cout <<
"Reference End time: " << Data2.
GetData().
GetTime().back() << endl;
68 cerr <<
"Component index not valid !";
74 cout <<
"Cross Hx: " << cross << endl;
77 cout <<
"Cross Hy: " << cross << endl;
80 cout <<
"Cross Ex: " << cross << endl;
83 cout <<
"Cross Ey: " << cross << endl;
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()
TimeSeriesComponent & GetHy()
TimeSeriesComponent is the base storage class for all types of time series data.
TimeSeriesData stores a pointer to the different components of magnetotelluric data and provides func...
size_t Size()
Return the size of the time series, throws if one of the components has a different size...
TimeSeriesComponent & GetEy()
TimeSeriesComponent & GetHx()
Access function for Hx, returns reference for efficiency.