FACT++  1.0
void palRefz ( double  zu,
double  refa,
double  refb,
double *  zr 
)

Definition at line 136 of file palRefz.c.

References DMIN, PAL__DD2R, PAL__DR2D, and t.

Referenced by palAopqk(), and t_ref().

136  {
137 
138  /* Constants */
139 
140  /* Largest usable ZD (deg) */
141  const double D93 = 93.0;
142 
143  /* ZD at which one model hands over to the other (radians) */
144  const double Z83 = 83.0 * PAL__DD2R;
145 
146  /* coefficients for high ZD model (used beyond ZD 83 deg) */
147  const double C1 = +0.55445;
148  const double C2 = -0.01133;
149  const double C3 = +0.00202;
150  const double C4 = +0.28385;
151  const double C5 = +0.02390;
152 
153  /* High-ZD-model prefiction (deg) for that point */
154  const double REF83 = (C1+C2*7.0+C3*49.0)/(1.0+C4*7.0+C5*49.0);
155 
156  double zu1,zl,s,c,t,tsq,tcu,ref,e,e2;
157 
158  /* perform calculations for zu or 83 deg, whichever is smaller */
159  zu1 = DMIN(zu,Z83);
160 
161  /* functions of ZD */
162  zl = zu1;
163  s = sin(zl);
164  c = cos(zl);
165  t = s/c;
166  tsq = t*t;
167  tcu = t*tsq;
168 
169  /* refracted zd (mathematically to better than 1 mas at 70 deg) */
170  zl = zl-(refa*t+refb*tcu)/(1.0+(refa+3.0*refb*tsq)/(c*c));
171 
172  /* further iteration */
173  s = sin(zl);
174  c = cos(zl);
175  t = s/c;
176  tsq = t*t;
177  tcu = t*tsq;
178  ref = zu1-zl+
179  (zl-zu1+refa*t+refb*tcu)/(1.0+(refa+3.0*refb*tsq)/(c*c));
180 
181  /* special handling for large zu */
182  if (zu > zu1) {
183  e = 90.0-DMIN(D93,zu*PAL__DR2D);
184  e2 = e*e;
185  ref = (ref/REF83)*(C1+C2*e+C3*e2)/(1.0+C4*e+C5*e2);
186  }
187 
188  /* return refracted zd */
189  *zr = zu-ref;
190 
191 }
#define DMIN(A, B)
Definition: palmac.h:129
static const double PAL__DD2R
Definition: palmac.h:72
static const double PAL__DR2D
Definition: palmac.h:81
TT t
Definition: test_client.c:26

+ Here is the caller graph for this function: