SFF++ library: reading and writing SFF from C++

◆ scanseries()

template<class C >
void sff::TraceHeader::scanseries ( const C &  c,
const Enormmode nm = NM_maxdyn 
)
inline

Definition at line 409 of file sffxx.h.

References sff::DAST::ampfac, sff::WaveformNormalizer::ampfac(), sff::WaveformNormalizer::limit, Mdast, Mscale, Mwid2, sff::WID2::nsamples, and sff::WaveformNormalizer::scale().

Referenced by sff::OutputWaveform< C >::OutputWaveform(), and test_waveform_normalizer().

411  {
412  Mwid2.nsamples=0;
413  double maxval=0.;
414  double absval, value;
415  double null(0);
416  for(aff::Browser<C> i(c); i.valid(); ++i)
417  {
418  Mwid2.nsamples++;
419  value= *i;
420  absval= (value < null) ? -value : value;
421  maxval= (maxval < absval) ? absval : maxval;
422  }
423  double dmaxval=double((maxval==0) ? WaveformNormalizer::limit : maxval);
424  WaveformNormalizer normalizer(nm, dmaxval);
425  Mdast.ampfac=normalizer.ampfac();
426  Mscale=normalizer.scale();
427  } // TraceHeader::scanseries
static const int limit
the absolute maximum amplitude (one-sided) to which the time series will be normalized.
Definition: sffxx.h:270
int nsamples
number of samples
Definition: sffxx.h:219
double ampfac
Definition: sffxx.h:187
Here is the call graph for this function:
Here is the caller graph for this function: