Commit 813391f7 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

plot gap and break indicators

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4686
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 48ea561c
......@@ -30,11 +30,12 @@
*
* REVISIONS and CHANGES
* - 14/02/2012 V1.0 Thomas Forbriger
* - 02/05/2012 V1.1 plot gap and break indicators too
*
* ============================================================================
*/
#define TF_FNGNUPLOTPLOT_CC_VERSION \
"TF_FNGNUPLOTPLOT_CC V1.0 "
"TF_FNGNUPLOTPLOT_CC V1.1"
#define TF_FNGNUPLOTPLOT_CC_CVSID \
"$Id$"
......@@ -61,6 +62,17 @@ void gnuplotplot(std::ostream& os,
++I;
}
int maxval=aff::func::max(total);
bool gapsexist=(maxval>0);
maxval = maxval > 1 ? maxval : 1;
// are there gaps or breaks?
unsigned int ntotalbreaks=0;
for (Tvecofgaps::const_iterator I=vog.begin(); I!=vog.end(); ++I)
{
Gapsummary summary=I->summarize();
ntotalbreaks += summary.nbreaks;
} // for (Tvecofgaps::const_iterator I=vog.begin(); I!=vog.end(); ++I)
bool breaksexist=(ntotalbreaks>0);
// create header
os << "set terminal postscript color solid\n";
......@@ -105,7 +117,7 @@ void gnuplotplot(std::ostream& os,
os << " \'-\' using 1:3:2 with labels center offset 0,-0.8 notitle";
}
++I;
if (I!=vog.end())
if (I!=vog.end() || breaksexist || gapsexist)
{
os << ", \\\n ";
}
......@@ -114,8 +126,28 @@ void gnuplotplot(std::ostream& os,
os << "\n";
}
}
if (gapsexist)
{
os << " \'-\' using 1:2 title \"gaps\" with points ps 2 pt 13 lt 1";
if (breaksexist)
{
os << ", \\\n ";
}
else
{
os << "\n";
}
}
if (breaksexist)
{
os << " \'-\' using 1:2 title \"breaks\" with points ps 1 pt 8 lt 3\n";
}
// setup data
// ==========
//
// number of missing samples
// -------------------------
unsigned int nperstream=1;
if (printlabels) { nperstream=2; }
I=vog.begin();
......@@ -138,6 +170,50 @@ void gnuplotplot(std::ostream& os,
}
++I;
}
//
// gap indicators
// --------------
if (gapsexist)
{
I=vog.begin();
while (I!=vog.end())
{
GapSeries gs=seriesofmissingsamples(*I, cb);
for (unsigned int j=0; j<cb.nbins(); ++j)
{
if (gs.gapseries(j)>0)
{
libtime::TAbsoluteTime time=cb.bin(j)+cb.binsize()/2;
os << time.hierarchicalstring() << " 0\n";
}
}
++I;
}
os << "e\n";
}
//
// gap break indicators
// --------------------
if (breaksexist)
{
I=vog.begin();
while (I!=vog.end())
{
for (Gapsofstream::Tvecofgap::const_iterator J=I->gap.begin();
J!=I->gap.end(); ++J)
{
if (J->isbreak())
{
libtime::TAbsoluteTime time=J->first;
os << time.hierarchicalstring() << " 0\n";
}
}
++I;
}
os << "e\n";
}
}
/* ----- END OF fngnuplotplot.cc ----- */
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