FACT++  1.0
void palAtmdsp ( double  tdk,
double  pmb,
double  rh,
double  wl1,
double  a1,
double  b1,
double  wl2,
double *  a2,
double *  b2 
)

Definition at line 129 of file palAtmdsp.c.

References DMAX, and DMIN.

Referenced by t_ref().

130  {
131 
132  double f,tdkok,pmbok,rhok;
133  double psat,pwo,w1,wlok,wlsq,w2,dn1,dn2;
134 
135  /* Check for radio wavelengths */
136  if (wl1 > 100.0 || wl2 > 100.0) {
137 
138  /* Radio: no dispersion */
139  *a2 = a1;
140  *b2 = b1;
141 
142  } else {
143 
144  /* Optical: keep arguments within safe bounds */
145  tdkok = DMIN(DMAX(tdk,100.0),500.0);
146  pmbok = DMIN(DMAX(pmb,0.0),10000.0);
147  rhok = DMIN(DMAX(rh,0.0),1.0);
148 
149  /* Atmosphere parameters at the observer */
150  psat = pow(10.0, -8.7115+0.03477*tdkok);
151  pwo = rhok*psat;
152  w1 = 11.2684e-6*pwo;
153 
154  /* Refractivity at the observer for first wavelength */
155  wlok = DMAX(wl1,0.1);
156  wlsq = wlok*wlok;
157  w2 = 77.5317e-6+(0.43909e-6+0.00367e-6/wlsq)/wlsq;
158  dn1 = (w2*pmbok-w1)/tdkok;
159 
160  /* Refractivity at the observer for second wavelength */
161  wlok = DMAX(wl2,0.1);
162  wlsq = wlok*wlok;
163  w2 = 77.5317e-6+(0.43909e-6+0.00367e-6/wlsq)/wlsq;
164  dn2 = (w2*pmbok-w1)/tdkok;
165 
166  /* Scale the refraction coefficients (see Green 4.31, p93) */
167  if (dn1 != 0.0) {
168  f = dn2/dn1;
169  *a2 = a1*f;
170  *b2 = b1*f;
171  if (dn1 != a1) {
172  *b2 *= (1.0+dn1*(dn1-dn2)/(2.0*(dn1-a1)));
173  }
174  } else {
175  *a2 = a1;
176  *b2 = b1;
177  }
178  }
179 
180 }
#define DMIN(A, B)
Definition: palmac.h:129
#define DMAX(A, B)
Definition: palmac.h:126

+ Here is the caller graph for this function: