conv/many suite: convert (m)any seismic data format(s)
fncompleteness.cc
Go to the documentation of this file.
1 
37 #define TF_FNCOMPLETENESS_CC_VERSION \
38  "TF_FNCOMPLETENESS_CC V1.0 "
39 
40 #include "gapfunctions.h"
41 #include <tfxx/misc.h>
42 #include <aff/seriesoperators.h>
43 
47  const bool& debug)
48 {
49  TFXX_debug(debug, "completeness",
50  "just entered function" << "\n" << gs.header.ID);
51  CompletenessSeries retseries(gs.header);
52  retseries.completeness.copyin(gs.gapseries);
53  retseries.header=gs.header;
54  double samplesperbin
55  =static_cast<double>(gs.header.completenessbins.samplesinbin(gs.header.ID.dt));
56  retseries.completeness *= -100./samplesperbin;
57  retseries.completeness += 100.;
58  // handle first and last bin separately
59  for (unsigned int j=0; j<2; ++j)
60  {
61  unsigned int i=0;
62  if (j==1) { i=gs.gapseries.last(); }
63  samplesperbin
64  =static_cast<double>(gs.header.completenessbins.samplesinbin(i, gs.header.ID.dt));
65  TFXX_debug(debug, "completeness",
66  TFXX_value(j) << " " << TFXX_value(samplesperbin));
67  retseries.completeness(i)=
68  100.*(1.-static_cast<double>(gs.gapseries(i))/samplesperbin);
69  }
70  if (debug)
71  {
72  for (unsigned int j=retseries.completeness.first();
73  j<=retseries.completeness.last(); ++j)
74  {
75  std::cout << TFXX_value(j) << " "
76  << TFXX_value(retseries.completeness(j)) << "\n";
77  }
78  }
79  TFXX_debug(debug, "completeness",
80  "about to leave function");
81  return retseries;
82 } // CompletenessSeries completeness(const GapSeries& gs)
83 
84 /* ----- END OF fncompleteness.cc ----- */
Tgapseries gapseries
GapSeriesHeader header
a class to hold a gap series for one stream
CompletenessBins completenessbins
CompletenessSeries completeness(const GapSeries &gs, const bool &debug)
convert gaps to completeness
unsigned int samplesinbin(const libtime::TRelativeTime dt) const
number of samples to be expected in a bin
a class to hold a completeness series for one stream
libtime::TRelativeTime dt
GapSeriesHeader header
function prototypes used in gap analysis (prototypes)
Tcompletenessseries completeness