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

◆ samplesinbin() [2/2]

unsigned int CompletenessBins::samplesinbin ( const unsigned int &  i,
const libtime::TRelativeTime  dt 
) const

number of samples to be expected in this bin where absolute limits of the considered time window is earliest and latest.

Parameters
ibin index
dtsampling interval
Returns
number of samples in this bin

Definition at line 117 of file completenessbins.cc.

References bin(), binsize(), earliest(), latest(), nbins(), and nextbin().

119 {
120  libtime::TRelativeTime binsize=this->binsize();
121  if (i==0)
122  {
123  binsize=this->nextbin(i)-this->earliest();
124  }
125  else if ((i+1)==this->nbins())
126  {
127  binsize=dt+this->latest()-this->bin(i);
128  }
129  unsigned int nsamples=binsize/dt;
130  nsamples = nsamples > 0 ? nsamples : 1;
131  return(nsamples);
132 } // unsigned int
libtime::TAbsoluteTime earliest() const
unsigned int nbins() const
libtime::TAbsoluteTime bin(const unsigned int &i) const
beginnig of bin (according to bin raster)
libtime::TAbsoluteTime latest() const
libtime::TRelativeTime binsize() const
libtime::TAbsoluteTime nextbin(const unsigned int &i) const
start of bin (will be earliest for fisrt bin)
Here is the call graph for this function: