aboutsummaryrefslogtreecommitdiff
path: root/src/slalib/airmas.f
blob: 12431c84f69ec9ca504be95fc53e56b6f81017c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
DOUBLE PRECISION FUNCTION sla_AIRMAS (ZD)
*+
*     - - - - - - -
*      A I R M A S
*     - - - - - - -
*
*  Air mass at given zenith distance (double precision)
*
*  Given:
*     ZD     d     Observed zenith distance (radians)
*
*  The result is an estimate of the air mass, in units of that
*  at the zenith.
*
*  Notes:
*
*  1)  The "observed" zenith distance referred to above means "as
*      affected by refraction".
*
*  2)  Uses Hardie's (1962) polynomial fit to Bemporad's data for
*      the relative air mass, X, in units of thickness at the zenith
*      as tabulated by Schoenberg (1929). This is adequate for all
*      normal needs as it is accurate to better than 0.1% up to X =
*      6.8 and better than 1% up to X = 10. Bemporad's tabulated
*      values are unlikely to be trustworthy to such accuracy
*      because of variations in density, pressure and other
*      conditions in the atmosphere from those assumed in his work.
*
*  3)  The sign of the ZD is ignored.
*
*  4)  At zenith distances greater than about ZD = 87 degrees the
*      air mass is held constant to avoid arithmetic overflows.
*
*  References:
*     Hardie, R.H., 1962, in "Astronomical Techniques"
*        ed. W.A. Hiltner, University of Chicago Press, p180.
*     Schoenberg, E., 1929, Hdb. d. Ap.,
*        Berlin, Julius Springer, 2, 268.
*
*  Original code by P.W.Hill, St Andrews
*
*  P.T.Wallace   Starlink   18 March 1999
*
*  Copyright (C) 1999 Rutherford Appleton Laboratory
*-

      IMPLICIT NONE

      DOUBLE PRECISION ZD

      DOUBLE PRECISION SECZM1


      SECZM1 = 1D0/(COS(MIN(1.52D0,ABS(ZD))))-1D0
      sla_AIRMAS = 1D0 + SECZM1*(0.9981833D0
     :             - SECZM1*(0.002875D0 + 0.0008083D0*SECZM1))

      END