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

◆ WaveformNormalizer()

sff::WaveformNormalizer::WaveformNormalizer ( const Enormmode nm,
const double &  maxval 
)

Definition at line 915 of file sffxx.cc.

References limit, Mampfac, Mmaxval, Mnorm, Mscale, sff::NM_ifneeded, sff::NM_maxdyn, and sff::NM_one.

916  :
917  Mmaxval(maxval), Mnorm(nm)
918  {
919  if (Mnorm == NM_one)
920  {
921  Mampfac=1.;
922  Mscale=false;
923  if (Mmaxval > double(WaveformNormalizer::limit)) throw
924  GSE2::Terror("ERROR (sff::WaveformNormalizer::scan): "
925  "dynamic range to large for non-normalizing mode");
926  }
927  else if (Mnorm == NM_ifneeded)
928  {
929  Mampfac=1.;
930  Mscale=false;
931  if (Mmaxval > double(WaveformNormalizer::limit))
932  {
934  Mscale=true;
935  }
936  }
937  else if (Mnorm == NM_maxdyn)
938  {
940  Mscale=true;
941  }
942  else throw
943  GSE2::Terror("ERROR (sff::WaveformNormalizer::scan): "
944  "library inconsistency!");
945  }
static const int limit
the absolute maximum amplitude (one-sided) to which the time series will be normalized.
Definition: sffxx.h:270
const double & maxval() const
Definition: sffxx.h:272
do not scale
Definition: sffxx.h:115
scale if largest amplitude larger than limit
Definition: sffxx.h:117
scale for maximum dynamic range
Definition: sffxx.h:116