conv/many suite: convert (m)any seismic data format(s)

◆ completeness()

CompletenessSeries completeness ( const GapSeries gs,
const bool &  debug = false 
)

convert gaps to completeness

Definition at line 46 of file fncompleteness.cc.

References CompletenessSeries::completeness, GapSeriesHeader::completenessbins, Gapid::dt, GapSeries::gapseries, GapSeries::header, CompletenessSeries::header, GapSeriesHeader::ID, and CompletenessBins::samplesinbin().

Referenced by main(), and printgaps().

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)
Tgapseries gapseries
CompletenessBins completenessbins
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
Here is the call graph for this function:
Here is the caller graph for this function: