7 * dec varies from -89 to 89, inclusive.
8 * ra varies depending on dec; each patch is about 1 square degree.
10 * Northern hemisphere (0<=dec<=89):
11 * from 0<=dec<=59, ra is every 4m, 360 values
12 * from 60<=dec<=69, ra is every 8m, 180 values
13 * from 70<=dec<=79, ra is every 12m, 120 values
14 * from 80<=dec<=84, ra is every 24m, 60 values
15 * at dec=85 and 86, ra is every 48m, 30 values
16 * at dec=87, ra is every 60m, 24 values
17 * at dec=88, ra is every 120m, 12 values
18 * at dec=89, ra is 12h, 1 value
20 * Total number of patches in northern hemisphere is therefore:
21 * 360*60+180*10+120*10+60*5+30*2+24*1+12*1+1 = 24997
22 * Total number of patches is therefore
23 * 2*24997-360 = 49634 (dec=0 has been counted twice)
24 * (cf. 41253 square degrees in the sky)
28 radec(int p, int *rah, int *ram, int *deg)
39 patcha(Angle ra, Angle dec)
44 return patch(floor(ra/15), ((int)floor(ra*4))%60, floor(dec));
46 return patch(floor(ra/15), ((int)floor(ra*4))%60, -floor(dec));
49 #define round scatround
51 char round[91]={ /* extra 0 is to offset the array */
52 /* 0 */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
53 /* 10 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
54 /* 20 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
55 /* 30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
56 /* 40 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
57 /* 50 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
58 /* 60 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
59 /* 70 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
60 /* 80 */ 6, 6, 6, 6, 6, 12, 12, 15, 30, -1,
65 patch(int rah, int ram, int deg)
70 * patches go from lower limit <= position < upper limit.
71 * therefore dec ' " can be ignored; always inc. dec degrees.
72 * the computed angle is then the upper limit (ignoring sign).
73 * when done, +ve values are shifted down so 90 (0 degrees) is a value;
75 if(rah<0 || rah>=24 || ram<0 || abs(deg)>=90){
76 fprint(2, "scat: patch: bad ra or dec %dh%dm %d\n", rah, ram, deg);
86 fprint(2, "scat: patch: panic %dh%dm %d\n", rah, ram, deg);
95 /* close the hole at 0 */