~ubuntu-branches/ubuntu/raring/starlink-pal/raring-proposed

« back to all changes in this revision

Viewing changes to palEtrms.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2012-03-28 11:00:00 UTC
  • Revision ID: package-import@ubuntu.com-20120328110000-9iw40yuy69wuk7po
Tags: upstream-0.1.0
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
*     {enter_further_changes_here}
 
47
 
 
48
*  Copyright:
 
49
*     Copyright (C) 2012 Science and Technology Facilities Council.
 
50
*     All Rights Reserved.
 
51
 
 
52
*  Licence:
 
53
*     This program is free software; you can redistribute it and/or
 
54
*     modify it under the terms of the GNU General Public License as
 
55
*     published by the Free Software Foundation; either version 3 of
 
56
*     the License, or (at your option) any later version.
 
57
*
 
58
*     This program is distributed in the hope that it will be
 
59
*     useful, but WITHOUT ANY WARRANTY; without even the implied
 
60
*     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
61
*     PURPOSE. See the GNU General Public License for more details.
 
62
*     You should have received a copy of the GNU General Public License
 
63
*     along with this program; if not, write to the Free Software
 
64
*     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 
65
*     USA.
 
66
 
 
67
*  Bugs:
 
68
*     {note_any_bugs_here}
 
69
*-
 
70
*/
 
71
 
 
72
#include "pal.h"
 
73
#include "palmac.h"
 
74
 
 
75
void palEtrms ( double ep, double ev[3] ) {
 
76
 
 
77
  /* Use the J2000 aberration constant */
 
78
  const double ABCONST = 20.49552;
 
79
 
 
80
  double t, e, e0, p, ek, cp;
 
81
 
 
82
  /*  Julian centuries since B1950 */
 
83
  t = (ep - 1950.) * .0100002135903;
 
84
 
 
85
  /*  Eccentricity */
 
86
  e = .01673011 - (t * 1.26e-7 + 4.193e-5) * t;
 
87
 
 
88
  /*  Mean obliquity */
 
89
  e0 = (84404.836 - ((t * .00181 + .00319) * t + 46.8495) * t) * 
 
90
    PAL__DAS2R;
 
91
 
 
92
  /*  Mean longitude of perihelion */
 
93
  p = (((t * .012 + 1.65) * t + 6190.67) * t + 1015489.951) * 
 
94
    PAL__DAS2R;
 
95
 
 
96
  /*  E-terms */
 
97
  ek = e * ABCONST * PAL__DAS2R;
 
98
  cp = cos(p);
 
99
  ev[0] = ek * sin(p);
 
100
  ev[1] = -ek * cp * cos(e0);
 
101
  ev[2] = -ek * cp * sin(e0);
 
102
 
 
103
}