line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
/* |
2
|
|
|
|
|
|
|
*+ |
3
|
|
|
|
|
|
|
* Name: |
4
|
|
|
|
|
|
|
* palEtrms |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
* Purpose: |
7
|
|
|
|
|
|
|
* Compute the E-terms vector |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
* Language: |
10
|
|
|
|
|
|
|
* Starlink ANSI C |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
* Type of Module: |
13
|
|
|
|
|
|
|
* Library routine |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
* Invocation: |
16
|
|
|
|
|
|
|
* void palEtrms ( double ep, double ev[3] ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
* Arguments: |
19
|
|
|
|
|
|
|
* ep = double (Given) |
20
|
|
|
|
|
|
|
* Besselian epoch |
21
|
|
|
|
|
|
|
* ev = double [3] (Returned) |
22
|
|
|
|
|
|
|
* E-terms as (dx,dy,dz) |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
* Description: |
25
|
|
|
|
|
|
|
* Computes the E-terms (elliptic component of annual aberration) |
26
|
|
|
|
|
|
|
* vector. |
27
|
|
|
|
|
|
|
* |
28
|
|
|
|
|
|
|
* Note the use of the J2000 aberration constant (20.49552 arcsec). |
29
|
|
|
|
|
|
|
* This is a reflection of the fact that the E-terms embodied in |
30
|
|
|
|
|
|
|
* existing star catalogues were computed from a variety of |
31
|
|
|
|
|
|
|
* aberration constants. Rather than adopting one of the old |
32
|
|
|
|
|
|
|
* constants the latest value is used here. |
33
|
|
|
|
|
|
|
* |
34
|
|
|
|
|
|
|
* See also: |
35
|
|
|
|
|
|
|
* - Smith, C.A. et al., 1989. Astr.J. 97, 265. |
36
|
|
|
|
|
|
|
* - Yallop, B.D. et al., 1989. Astr.J. 97, 274. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
* Authors: |
39
|
|
|
|
|
|
|
* PTW: Pat Wallace (STFC) |
40
|
|
|
|
|
|
|
* TIMJ: Tim Jenness (JAC, Hawaii) |
41
|
|
|
|
|
|
|
* {enter_new_authors_here} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
* History: |
44
|
|
|
|
|
|
|
* 2012-02-12 (TIMJ): |
45
|
|
|
|
|
|
|
* Initial version with documentation taken from Fortran SLA |
46
|
|
|
|
|
|
|
* Adapted with permission from the Fortran SLALIB library. |
47
|
|
|
|
|
|
|
* {enter_further_changes_here} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
* Copyright: |
50
|
|
|
|
|
|
|
* Copyright (C) 1996 Rutherford Appleton Laboratory |
51
|
|
|
|
|
|
|
* Copyright (C) 2012 Science and Technology Facilities Council. |
52
|
|
|
|
|
|
|
* All Rights Reserved. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
* Licence: |
55
|
|
|
|
|
|
|
* This program is free software: you can redistribute it and/or |
56
|
|
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public |
57
|
|
|
|
|
|
|
* License as published by the Free Software Foundation, either |
58
|
|
|
|
|
|
|
* version 3 of the License, or (at your option) any later |
59
|
|
|
|
|
|
|
* version. |
60
|
|
|
|
|
|
|
* |
61
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful, |
62
|
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
63
|
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
64
|
|
|
|
|
|
|
* GNU Lesser General Public License for more details. |
65
|
|
|
|
|
|
|
* |
66
|
|
|
|
|
|
|
* You should have received a copy of the GNU Lesser General |
67
|
|
|
|
|
|
|
* License along with this program. If not, see |
68
|
|
|
|
|
|
|
* . |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
* Bugs: |
71
|
|
|
|
|
|
|
* {note_any_bugs_here} |
72
|
|
|
|
|
|
|
*- |
73
|
|
|
|
|
|
|
*/ |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
#include "pal.h" |
76
|
|
|
|
|
|
|
#include "palmac.h" |
77
|
|
|
|
|
|
|
|
78
|
2
|
|
|
|
|
|
void palEtrms ( double ep, double ev[3] ) { |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
/* Use the J2000 aberration constant */ |
81
|
|
|
|
|
|
|
const double ABCONST = 20.49552; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
double t, e, e0, p, ek, cp; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
/* Julian centuries since B1950 */ |
86
|
2
|
|
|
|
|
|
t = (ep - 1950.) * .0100002135903; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
/* Eccentricity */ |
89
|
2
|
|
|
|
|
|
e = .01673011 - (t * 1.26e-7 + 4.193e-5) * t; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
/* Mean obliquity */ |
92
|
2
|
|
|
|
|
|
e0 = (84404.836 - ((t * .00181 + .00319) * t + 46.8495) * t) * |
93
|
|
|
|
|
|
|
PAL__DAS2R; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
/* Mean longitude of perihelion */ |
96
|
2
|
|
|
|
|
|
p = (((t * .012 + 1.65) * t + 6190.67) * t + 1015489.951) * |
97
|
|
|
|
|
|
|
PAL__DAS2R; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
/* E-terms */ |
100
|
2
|
|
|
|
|
|
ek = e * ABCONST * PAL__DAS2R; |
101
|
2
|
|
|
|
|
|
cp = cos(p); |
102
|
2
|
|
|
|
|
|
ev[0] = ek * sin(p); |
103
|
2
|
|
|
|
|
|
ev[1] = -ek * cp * cos(e0); |
104
|
2
|
|
|
|
|
|
ev[2] = -ek * cp * sin(e0); |
105
|
|
|
|
|
|
|
|
106
|
2
|
|
|
|
|
|
} |