source: trunk/MagicSoft/slalib/airmas.c@ 18282

Last change on this file since 18282 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3double slaAirmas ( double zd )
4/*
5** - - - - - - - - - -
6** s l a A i r m a s
7** - - - - - - - - - -
8**
9** Air mass at given zenith distance.
10**
11** (double precision)
12**
13** Given:
14** zd d observed zenith distance (radians)
15**
16** The result is an estimate of the air mass, in units of that
17** at the zenith.
18**
19** Notes:
20**
21** 1) The "observed" zenith distance referred to above means "as
22** affected by refraction".
23**
24** 2) Uses Hardie's (1962) polynomial fit to Bemporad's data for
25** the relative air mass, X, in units of thickness at the zenith
26** as tabulated by Schoenberg (1929). This is adequate for all
27** normal needs as it is accurate to better than 0.1% up to X =
28** 6.8 and better than 1% up to X = 10. Bemporad's tabulated
29** values are unlikely to be trustworthy to such accuracy
30** because of variations in density, pressure and other
31** conditions in the atmosphere from those assumed in his work.
32**
33** 3) The sign of the ZD is ignored.
34**
35** 4) At zenith distances greater than about ZD = 87 degrees the
36** air mass is held constant to avoid arithmetic overflows.
37**
38** References:
39** Hardie, R.H., 1962, in "Astronomical Techniques"
40** ed. W.A. Hiltner, University of Chicago Press, p180.
41** Schoenberg, E., 1929, Hdb. d. Ap.,
42** Berlin, Julius Springer, 2, 268.
43**
44** Adapted from original Fortran code by P.W.Hill, St Andrews.
45**
46** Last revision: 5 October 1994
47**
48** Copyright P.T.Wallace. All rights reserved.
49*/
50{
51 double w, seczm1;
52
53 w = fabs ( zd );
54 seczm1 = 1.0 / ( cos ( gmin ( 1.52, w ) ) ) - 1.0;
55 return 1.0 + seczm1 * ( 0.9981833
56 - seczm1 * ( 0.002875 + 0.0008083 * seczm1 ) );
57}
Note: See TracBrowser for help on using the repository browser.