39 #define TF_FNGNUPLOTPLOT_CC_VERSION \ 40 "TF_FNGNUPLOTPLOT_CC V1.2" 43 #include <aff/functions/max.h> 46 const std::string& psname,
51 Tvecofgaps::const_iterator I=vog.begin();
58 for (
unsigned j=0; j<cb.
nbins(); ++j)
64 int maxval=aff::func::max(total);
65 bool gapsexist=(maxval>0);
66 maxval = maxval > 1 ? maxval : 1;
69 unsigned int ntotalbreaks=0;
70 for (Tvecofgaps::const_iterator I=vog.begin(); I!=vog.end(); ++I)
73 ntotalbreaks += summary.
nbreaks;
75 bool breaksexist=(ntotalbreaks>0);
78 os <<
"set terminal postscript color solid\n";
79 os <<
"set output \"" << psname <<
"\"\n";
80 os <<
"set title \"data gaps in bins of " 81 << cb.
binsize().timestring() <<
"\\n" 83 << cb.
earliest().timestring().substr(4)
85 << cb.
latest().timestring().substr(4)
87 os <<
"set ylabel \"number of missing samples\"\n";
88 os <<
"set timefmt \"%Y/%m/%d-%H:%M:%S\"\n";
89 os <<
"set xdata time\n";
91 if (dur > libtime::TRelativeTime(5))
93 os <<
"set format x \"%d.%m.%y\"\n";
95 else if (dur > libtime::TRelativeTime(1))
97 os <<
"set format x \"%d.%m.%y %H\"\n";
101 os <<
"set format x \"%d.%m.%y %H:%M\"\n";
103 os <<
"set boxwidth 0.9 relative\n";
104 os <<
"set style fill solid 0.2 border -1\n";
105 os <<
"set xtic rotate by -45 scale 0\n";
107 os <<
"set key outside enhanced horizontal\n";
108 os <<
"set auto x\n";
109 os <<
"set yrange [" << -0.05 * maxval <<
":" << 1.05*maxval <<
"]\n";
112 bool printlabels=(cb.
nbins()<20);
118 os <<
"\'-\' using 1:3 title \"" << I->ID.ID <<
"\" with boxes";
122 os <<
" \'-\' using 1:3:2 with labels center offset 0,-0.8 notitle";
125 if (I!=vog.end() || breaksexist || gapsexist)
136 os <<
" \'-\' using 1:2 title \"gaps\" with points ps 2 pt 13 lt 1";
148 os <<
" \'-\' using 1:2 title \"breaks\" with points ps 1 pt 8 lt 3\n";
156 unsigned int nperstream=1;
157 if (printlabels) { nperstream=2; }
162 for (
unsigned int i=0; i<nperstream; ++i)
164 for (
unsigned int j=0; j<cb.
nbins(); ++j)
166 libtime::TAbsoluteTime time=cb.
bin(j)+cb.
binsize()/2;
167 os << time.hierarchicalstring()
168 <<
" " << gs.
gapseries(j) <<
" " << total(j) <<
"\n";
172 for (
unsigned int j=0; j<cb.
nbins(); ++j)
188 for (
unsigned int j=0; j<cb.
nbins(); ++j)
192 libtime::TAbsoluteTime time=cb.
bin(j)+cb.
binsize()/2;
193 os << time.hierarchicalstring() <<
" 0\n";
209 for (Gapsofstream::Tvecofgap::const_iterator J=I->gap.begin();
210 J!=I->gap.end(); ++J)
214 libtime::TAbsoluteTime time=J->first;
215 os << time.hierarchicalstring() <<
" 0\n";
a class to hold a gap series for one stream
libtime::TAbsoluteTime earliest() const
unsigned int nbins() const
libtime::TAbsoluteTime bin(const unsigned int &i) const
beginnig of bin (according to bin raster)
GapSeries seriesofmissingsamples(const Gapsofstream &gos, const CompletenessBins &cb, const bool &debug)
Function to extract a GapSeries from given Gapsofstream.
class to define the time axis of the completeness time series.
unsigned int nbreaks
total number of breaks
libtime::TAbsoluteTime latest() const
struct to present a summary
::aff::Series< int > Tgapseries
std::vector< Gapsofstream > Tvecofgaps
vector to hold all gaps
void gnuplotplot(std::ostream &os, const std::string &psname, const CompletenessBins &cb, const Tvecofgaps &vog)
libtime::TRelativeTime binsize() const
function prototypes used in gap analysis (prototypes)