Commit 56c1d03d authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libtsxx [WP]: use sff-function in TimeSeriesCollection::overlap

parent 0b7a6784
......@@ -130,16 +130,13 @@ namespace ts {
typename Tbase::const_iterator i_series=this->begin();
Theader header=i_series->header;
libtime::TAbsoluteTime begin=header.date;
libtime::TRelativeTime dt=libtime::double2time(header.dt);
libtime::TAbsoluteTime end=header.date+(dt*(header.nsamples-1));
libtime::TAbsoluteTime end=sff::wid2lastsample(header);
++i_series;
while ((i_series != this->end()) && retval)
{
header=i_series->header;
libtime::TAbsoluteTime thisbegin=header.date;
libtime::TRelativeTime thisdt=libtime::double2time(header.dt);
libtime::TAbsoluteTime thisend=
header.date+(thisdt*(header.nsamples-1));
libtime::TAbsoluteTime thisend=sff::wid2lastsample(header);
begin = thisbegin > begin ? thisbegin : begin;
end = thisend < end ? thisend : end;
++i_series;
......@@ -184,9 +181,8 @@ namespace ts {
{
if (this->size() > 1)
{
typename Tbase::const_iterator i_series=this->begin();
// find lastest start date
typename Tbase::const_iterator i_series=this->begin();
Theader header=i_series->header;
libtime::TAbsoluteTime begin=header.date;
++i_series;
......@@ -197,6 +193,8 @@ namespace ts {
begin = thisbegin > begin ? thisbegin : begin;
++i_series;
}
// adjust series and header
}
} // void TimeSeriesCollection<T>::trim_to_date()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment