ocssw V2020
airmass.c
Go to the documentation of this file.
1 #include "l12_proto.h"
2 
3 /* airmass for a spherical atmosphere, Kasten & Young, 1989 */
4 float ky_airmass(float theta) {
5  float mu = MAX(cos(theta / RADEG), 0.01);
6  return (1. / (mu + pow(0.50572 * (96.07995 - theta), (-1.6364))));
7 }
8 
9 float ky_airmass_(float *theta) {
10  return (ky_airmass(*theta));
11 }
12 
13 /* airmass for a plane parallel atmosphere */
14 float pp_airmass(float theta) {
15  float mu = MAX(cos(theta / RADEG), 0.01);
16  return (1. / mu);
17 }
18 
19 float pp_airmass_(float *theta) {
20  return (pp_airmass(*theta));
21 }
#define MAX(A, B)
Definition: swl0_utils.h:26
float pp_airmass(float theta)
Definition: airmass.c:14
constexpr double RADEG
float mu
float pp_airmass_(float *theta)
Definition: airmass.c:19
float ky_airmass_(float *theta)
Definition: airmass.c:9
float ky_airmass(float theta)
Definition: airmass.c:4