FACT++  1.0
void eraRefco ( double  phpa,
double  tc,
double  rh,
double  wl,
double *  refa,
double *  refb 
)

Definition at line 3 of file refco.c.

References ERFA_GMAX, ERFA_GMIN, and t.

Referenced by eraApco13(), eraApio13(), palRefcoq(), and t_refco().

151 {
152  int optic;
153  double p, t, r, w, ps, pw, tk, wlsq, gamma, beta;
154 
155 /* Decide whether optical/IR or radio case: switch at 100 microns. */
156  optic = ( wl <= 100.0 );
157 
158 /* Restrict parameters to safe values. */
159  t = ERFA_GMAX ( tc, -150.0 );
160  t = ERFA_GMIN ( t, 200.0 );
161  p = ERFA_GMAX ( phpa, 0.0 );
162  p = ERFA_GMIN ( p, 10000.0 );
163  r = ERFA_GMAX ( rh, 0.0 );
164  r = ERFA_GMIN ( r, 1.0 );
165  w = ERFA_GMAX ( wl, 0.1 );
166  w = ERFA_GMIN ( w, 1e6 );
167 
168 /* Water vapour pressure at the observer. */
169  if ( p > 0.0 ) {
170  ps = pow ( 10.0, ( 0.7859 + 0.03477*t ) /
171  ( 1.0 + 0.00412*t ) ) *
172  ( 1.0 + p * ( 4.5e-6 + 6e-10*t*t ) );
173  pw = r * ps / ( 1.0 - (1.0-r)*ps/p );
174  } else {
175  pw = 0.0;
176  }
177 
178 /* Refractive index minus 1 at the observer. */
179  tk = t + 273.15;
180  if ( optic ) {
181  wlsq = w * w;
182  gamma = ( ( 77.53484e-6 +
183  ( 4.39108e-7 + 3.666e-9/wlsq ) / wlsq ) * p
184  - 11.2684e-6*pw ) / tk;
185  } else {
186  gamma = ( 77.6890e-6*p - ( 6.3938e-6 - 0.375463/tk ) * pw ) / tk;
187  }
188 
189 /* Formula for beta from Stone, with empirical adjustments. */
190  beta = 4.4474e-6 * tk;
191  if ( ! optic ) beta -= 0.0074 * pw * beta;
192 
193 /* Refraction constants from Green. */
194  *refa = gamma * ( 1.0 - beta );
195  *refb = - gamma * ( beta - gamma / 2.0 );
196 
197 /* Finished. */
198 
199 }
#define ERFA_GMAX(A, B)
Definition: erfam.h:134
TT t
Definition: test_client.c:26
#define ERFA_GMIN(A, B)
Definition: erfam.h:137

+ Here is the caller graph for this function: