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

◆ convertandscale()

template<class C >
C datrw::pdas::convertandscale ( const Tdata data,
const Etype type 
)

function to scale data

Definition at line 108 of file pdasread.h.

References datrw::mseed::key::data, DATRW_abort, FtypeGAINRANGED, FtypeINT, and FtypeLONG.

109  {
110  long unsigned int factor;
111  if (type==FtypeINT)
112  { factor=0x8000; }
113  else if (type==FtypeLONG)
114  { factor=0x80000000; }
115  else if (type==FtypeGAINRANGED)
116  { factor=0x10000000; }
117  else
118  { DATRW_abort("illegal data type"); }
119  typedef typename C::Tvalue Tcontfactor;
120  Tcontfactor cfactor=Tcontfactor(factor);
121  return(datrw::pdas::convert<C>(data) / cfactor);
122  }
const char *const data
keywords for consistency checks
int Tvalue
Definition: pdasread.h:75
#define DATRW_abort(M)
Abort and give a message.
Definition: error.h:101