5 #include <boost/date_time/posix_time/posix_time.hpp>
18 string version =
"$Id: mtucut.cpp 1889 2016-05-25 13:16:12Z mmoorkamp $";
20 int main(
int argc,
char *argv[])
23 size_t newlength, startindex;
25 cout <<
"This is mtucut: Cut Phoenix time series to a given length" << endl
28 <<
"Ending .cut + ending [ts3,ts4,ts5] will be automatically assigned to outfilename"
30 cout <<
"This is Version: " <<
version << endl << endl;
38 infilename = AskFilename(
"Mtu-Filename: ");
44 cout <<
"Old Start time: " << Data.
GetData().
GetTime().front() << endl;
45 cout <<
"Old End time: " << Data.
GetData().
GetTime().back() << endl;
46 cout <<
"New length: ";
48 cout <<
"Startindex: ";
52 if (newlength + startindex > length)
54 cerr <<
"Selected segment is partially outside time series !";
67 cout <<
"New Start time: " << Data.
GetData().
GetTime().front() << endl;
68 cout <<
"New End time: " << Data.
GetData().
GetTime().back() << 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()
void erase(const int startindex, const int endindex)
Erase data between startindex and endindex.
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...
size_t Size()
Return the size of the time series, throws if one of the components has a different size...