STFINV library: seek source wavelet correction filter

◆ checkconsistency()

void stfinv::STFBaseEngine::checkconsistency ( ) const
private

Check consistency of data members.

Check consistency of time series data passed to the STFBaseEngine with respect to

  1. number of samples
  2. sampling interval

Definition at line 159 of file stfinvbase.cc.

References CWaveformHeader::dt, dt(), Mpairs, Mstf, Mtriples, CWaveformHeader::n, CTripleHeader::sampling, stfinv::Waveform::sampling, stfinv::Waveform::series, and STFINV_assert.

Referenced by initialize().

160  {
161  const unsigned int& n=Mstf.sampling.n;
162  const double& dt=Mstf.sampling.dt;
164  "inconsistent number of samples");
165  const double tolerance=1.e-4;
166 
167  {
168  stfinv::Tvectoroftriples::const_iterator I=Mtriples.begin();
169  while (I!=Mtriples.end())
170  {
171  CTripleHeader header=I->header;
172  STFINV_assert(header.sampling.n==n,
173  "inconsistent number of samples");
174  STFINV_assert(header.sampling.n==I->data.size(),
175  "inconsistent number of samples");
176  STFINV_assert(header.sampling.n==I->synthetics.size(),
177  "inconsistent number of samples");
178  STFINV_assert(header.sampling.n==I->convolvedsynthetics.size(),
179  "inconsistent number of samples");
180  STFINV_assert(std::abs(1.-header.sampling.dt/dt)<tolerance,
181  "inconsistent values of sampling interval");
182  ++I;
183  } // while (I!=Mtriples.end())
184  }
185 
186  {
187  stfinv::Tvectorofpairs::const_iterator I=Mpairs.begin();
188  while (I!=Mpairs.end())
189  {
190  CWaveformHeader sampling=I->sampling;
191  STFINV_assert(sampling.n==n,
192  "inconsistent number of samples");
193  STFINV_assert(sampling.n==I->synthetics.size(),
194  "inconsistent number of samples");
195  STFINV_assert(sampling.n==I->convolvedsynthetics.size(),
196  "inconsistent number of samples");
197  STFINV_assert(std::abs(1.-sampling.dt/dt)<tolerance,
198  "inconsistent values of sampling interval");
199  ++I;
200  } // while (I!=Mpairs.end())
201  }
202  }
struct CWaveformHeader sampling
Temporal sampling of all three waveforms.
CWaveformHeader sampling
Temporal sampling.
Definition: stfinvbase.h:114
stfinv::Waveform Mstf
source correction filter.
Definition: stfinvbase.h:332
Tseries series
Time series of waveform.
Definition: stfinvbase.h:117
stfinv::Tvectoroftriples Mtriples
Waveform triples.
Definition: stfinvbase.h:330
unsigned int n
Number of samples in time series array.
Structure to hold header information for a triple of waveforms.Each triple of waveforms reference by ...
#define STFINV_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:140
double dt
Sampling interval in seconds.
int n
Number of pairs in the array.
Definition: stfinv.h:190
double dt() const
return sampling interval
Definition: stfinvbase.h:265
stfinv::Tvectorofpairs Mpairs
Waveform pairs.
Definition: stfinvbase.h:334
Temporal sampling for time series data.
Here is the call graph for this function:
Here is the caller graph for this function: