Waveform filter programs

◆ convert_sidiode_volts_to_kelvin()

double DDAS3::convert_sidiode_volts_to_kelvin ( double  volts)

Definition at line 153 of file sigscale.cc.

References A, ND, TRANGE_100K, TRANGE_12K, TRANGE_24K, TRANGE_475K, VL, and VU.

Referenced by convert_to_display_units().

154  {
155  double x, t, v, vl, vu;
156  int i, nd, range;
157 
158  if ( volts < 0.24963 )
159  // clip value to 410K if out of range e.g.sensor unplugged
160  return 410.0 ;
161 
162  // Coefficients table ends at 1.4K
163  if ( volts > 1.698120 )
164  // clip value to 1.4K if out of range //changed 09/08
165  return 1.40 ;
166 
167  if ( volts > VU[TRANGE_12K] ) range = 0 ;
168  else if ( volts>VU[TRANGE_24K ] && volts<=VU[TRANGE_12K ] ) range = 0;
169  else if ( volts>VU[TRANGE_100K] && volts<=VU[TRANGE_24K ] ) range = 1;
170  else if ( volts>VU[TRANGE_475K] && volts<=VU[TRANGE_100K] ) range = 2;
171  else /*volts<=VU[TRANGE_475K]*/ range = 3;
172 
173  v = volts;
174  vl = VL[range];
175  vu = VU[range];
176  nd = ND[range];
177  x = ((v-vl)-(vu-v))/(vu-vl);
178 
179  if ( x <= -1.0 || x >= 1.0 ) x = 0 ; /* error condition */
180 
181  t = 0.0;
182  for( i=0; i<nd; i++ )
183  t = t + A[range][i]*cos(i*acos(x));
184 
185  return t;
186  } // double convert_sidiode_volts_to_kelvin(double volts)
const int ND[4]
Definition: sigscale.cc:84
const double A[4][12]
Definition: sigscale.cc:85
#define TRANGE_24K
Definition: sigscale.cc:97
const double VU[4]
Definition: sigscale.cc:83
#define TRANGE_475K
Definition: sigscale.cc:99
const double VL[4]
Definition: sigscale.cc:82
#define TRANGE_100K
Definition: sigscale.cc:98
#define TRANGE_12K
Definition: sigscale.cc:96
Here is the caller graph for this function: