DATRW++ library: seismic data I/O with multiple formats

◆ scaletopower()

int datrw::su::scaletopower ( short  s,
const bool &  strict = true 
)

convert a SeismicUn*x scale value to a decimal power

Parameters
sSeismicUn*x scale value like scalco or scalel
strictif true: abort if scale does not match original definition
Returns
corresponding exponent for the power of ten

Definition at line 485 of file sucomanager.cc.

References fixscalevalue(), and datrw::su::subformat::key::strict.

Referenced by datrw::su::ScalCoo::power(), and datrw::su::ScalCoo::smallestpower().

486  {
487  fixscalevalue(s, strict);
488  int sabs=s > 0 ? s : -s;
489  int retval=std::log10(sabs);
490  if (s < 0) { retval *= -1; }
491  return(retval);
492  } // int scaletopower(short s, const bool& strict=true)
const char *const strict
strictly interpret header as defined in SeismicUnix source
Definition: suformat.cc:65
void fixscalevalue(short &s, const bool &strict)
fix a SeismicUn*x scale value
Definition: sucomanager.cc:498
Here is the call graph for this function:
Here is the caller graph for this function: