-
Notifications
You must be signed in to change notification settings - Fork 72
/
exposure.clh
39 lines (26 loc) · 842 Bytes
/
exposure.clh
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
/*
Calculates the exposure function of the Pierre Auger Observatory.
Formula taken from Sommers, P. 2000, astro-ph/0004016. Based on the
function exposure.pro that I previously wrote for IDL.
Usage:
X=exposure(delta)
where delta is the declination in degrees.
*/
float exposure(float deltain) {
float delta, xi, lat, thetam, alpham, omega, exposure;
delta=deltain*M_PI_F/180.;
lat = -35.2*M_PI_F/180.; // latitude of PA
thetam = 60.*M_PI_F/180.; // maximum zenith angle of PA
xi = (cos(thetam) - sin(lat)*sin(delta))/(cos(lat)*cos(delta));
if (xi > 1) {
alpham=0.;
} else if (xi < -1) {
alpham=M_PI_F;
} else {
alpham=acos(xi);
}
omega = cos(lat)*cos(delta)*sin(alpham) + alpham*sin(lat)*sin(delta);
// Normalizes to 1, for the latitude and max. zenith angle of
// Pierre Auger
return omega/1.81092;
}