40 #define TF_FNPRINTGAPS_CC_VERSION \ 41 "TF_FNPRINTGAPS_CC V1.3" 44 #include <tfxx/misc.h> 47 const libtime::TAbsoluteTime& earliest,
48 const libtime::TAbsoluteTime& latest,
49 const unsigned int& lev)
53 os <<
"analysis period: " 54 << earliest.timestring().substr(4)
56 << latest.timestring().substr(4)
58 os <<
"gaps present in input data:\n";
60 unsigned int ntotalgaps=0;
61 unsigned int ntotalbreaks=0;
62 unsigned int ntotalmissing=0;
63 unsigned int ntotalexpected=0;
64 libtime::TRelativeTime ttotalexpected(0);
65 libtime::TRelativeTime ttotalmissing(0);
66 for (Tvecofgaps::const_iterator I=vog.begin(); I!=vog.end(); ++I)
68 if (lev<2) { os <<
"stream: " << I->ID << std::endl; }
69 for (Gapsofstream::Tvecofgap::const_iterator J=I->gap.begin();
72 if (lev<1) { os << *J << std::endl; }
79 ntotalgaps += summary.
ngaps;
80 ntotalbreaks += summary.
nbreaks;
83 ttotalexpected += summary.
tspan;
87 os <<
" number of breaks / number of gaps / number of missing samples / completeness:\n";
88 os <<
" " << summary.
nbreaks <<
" / ";
89 os << summary.
ngaps <<
" / ";
91 double tspan=libtime::time2double(summary.
tspan);
92 double tmissing=libtime::time2double(summary.
tmissing);
101 double tspan=libtime::time2double(ttotalexpected);
102 double tmissing=libtime::time2double(ttotalmissing);
106 os <<
"summary of entire analysis:\n";
107 os <<
"number of breaks / number of gaps / number of missing samples / completeness:\n";
108 os << ntotalbreaks <<
" / ";
109 os << ntotalgaps <<
" / ";
110 os << ntotalmissing <<
" / ";
112 ((ntotalbreaks+ntotalgaps+ntotalmissing)>0))
117 if (lev==3) { os << ntotalgaps << std::endl; }
118 if (lev==4) { os << ntotalmissing << std::endl; }
libtime::TRelativeTime tspan
time span of analysis
unsigned int ngaps
total number of gaps
unsigned int nbreaks
total number of breaks
CompletenessSeries completeness(const GapSeries &gs, const bool &debug)
convert gaps to completeness
struct to present a summary
unsigned int nmissing
number of missing samples
std::vector< Gapsofstream > Tvecofgaps
vector to hold all gaps
unsigned int nexpected
number of expected samples
void printgaps(std::ostream &os, const Tvecofgaps &vog, const libtime::TAbsoluteTime &earliest, const libtime::TAbsoluteTime &latest, const unsigned int &lev)
function prototypes used in gap analysis (prototypes)
libtime::TRelativeTime tmissing
time span not covered with samples