55 const libtime::TRelativeTime& dt=gos.
ID.
dt;
57 for (Gapsofstream::Tvecofgap::const_iterator G=gos.
gap.begin();
58 G!=gos.
gap.end(); ++G)
60 TFXX_debug(debug,
"seriesofmissingsamples",
61 "fill in gap: " << (*G));
62 const libtime::TAbsoluteTime& first=G->first;
63 const libtime::TAbsoluteTime& last=G->last;
64 libtime::TAbsoluteTime current=first;
68 for (
unsigned int i=0; i<cb.
nbins(); ++i)
70 TFXX_debug(debug,
"seriesofmissingsamples",
72 << cb.
bin(i).timestring() <<
" - " 74 TFXX_debug(debug,
"seriesofmissingsamples",
75 " current: " << current.timestring());
78 TFXX_debug(debug,
"seriesofmissingsamples",
79 "is in bin " << i <<
": " << current.timestring());
80 libtime::TAbsoluteTime nextbin=cb.
nextbin(i);
81 TFXX_debug(debug,
"seriesofmissingsamples",
82 TFXX_value(nextbin.timestring()) <<
" " <<
83 TFXX_value(last.timestring()));
86 unsigned int n=(nextbin-current)/dt;
87 while ((current+n*dt)<nextbin)
89 TFXX_debug(debug,
"seriesofmissingsamples",
91 " (current+n*dt): " <<
92 libtime::TAbsoluteTime(current+n*dt).timestring() <<
93 " nextbin: " << nextbin.timestring());
96 TFXX_debug(debug,
"seriesofmissingsamples",
98 " (current+n*dt): " <<
99 libtime::TAbsoluteTime(current+n*dt).timestring() <<
100 " nextbin: " << nextbin.timestring());
101 retseries.gapseries(i) += n;
106 unsigned int n=(last-current)/dt;
107 while ((current+n*dt)<=last)
109 TFXX_debug(debug,
"seriesofmissingsamples",
111 " (current+n*dt): " <<
112 libtime::TAbsoluteTime(current+n*dt).timestring() <<
113 " last: " << last.timestring());
116 TFXX_debug(debug,
"seriesofmissingsamples",
118 " (current+n*dt): " <<
119 libtime::TAbsoluteTime(current+n*dt).timestring() <<
120 " last: " << last.timestring());
121 retseries.gapseries(i) += n;
131 for (
unsigned int j=retseries.gapseries.first();
132 j<=retseries.gapseries.last(); ++j)
134 std::cout << TFXX_value(j) <<
" " 135 << TFXX_value(retseries.gapseries(j)) <<
"\n";
a class to hold a gap series for one stream
unsigned int nbins() const
libtime::TAbsoluteTime bin(const unsigned int &i) const
beginnig of bin (according to bin raster)
bool isinbin(const libtime::TAbsoluteTime &d, const unsigned int &i) const
libtime::TRelativeTime dt
libtime::TAbsoluteTime nextbin(const unsigned int &i) const
start of bin (will be earliest for fisrt bin)