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

« back to all changes in this revision

Viewing changes to palEpv.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
*     palEpv
 
5
 
 
6
*  Purpose:
 
7
*     Earth position and velocity with respect to the BCRS
 
8
 
 
9
*  Language:
 
10
*     Starlink ANSI C
 
11
 
 
12
*  Type of Module:
 
13
*     Library routine
 
14
 
 
15
*  Invocation:
 
16
*     void palEpv( double date, double ph[3], double vh[3],
 
17
*                  double pb[3], double vb[3] );
 
18
 
 
19
*  Arguments:
 
20
*     date = double (Given)
 
21
*        Date, TDB Modified Julian Date (JD-2400000.5)
 
22
*     ph = double [3] (Returned)
 
23
*        Heliocentric Earth position (AU)
 
24
*     vh = double [3] (Returned)
 
25
*        Heliocentric Earth velocity (AU/day)
 
26
*     pb = double [3] (Returned)
 
27
*        Barycentric Earth position (AU)
 
28
*     vb = double [3] (Returned)
 
29
*        Barycentric Earth velocity (AU/day)
 
30
 
 
31
*  Description:
 
32
*     Earth position and velocity, heliocentric and barycentric, with
 
33
*     respect to the Barycentric Celestial Reference System.
 
34
 
 
35
*  Authors:
 
36
*     TIMJ: Tim Jenness (JAC, Hawaii)
 
37
*     {enter_new_authors_here}
 
38
 
 
39
*  Notes:
 
40
*     - See iauEpv00 for details on accuracy
 
41
*     - Note that the status argument from iauEpv00 is ignored
 
42
 
 
43
*  History:
 
44
*     2012-03-12 (TIMJ):
 
45
*        Initial version
 
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
*
 
63
*     You should have received a copy of the GNU General Public License
 
64
*     along with this program; if not, write to the Free Software
 
65
*     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
66
*     MA 02110-1301, USA.
 
67
 
 
68
*  Bugs:
 
69
*     {note_any_bugs_here}
 
70
*-
 
71
*/
 
72
 
 
73
#include "palmac.h"
 
74
#include "pal.h"
 
75
#include "sofa.h"
 
76
 
 
77
void palEpv( double date, double ph[3], double vh[3],
 
78
             double pb[3], double vb[3] ) {
 
79
 
 
80
  int i;
 
81
  double pvh[2][3];
 
82
  double pvb[2][3];
 
83
 
 
84
  iauEpv00( PAL__MJD0, date, pvh, pvb );
 
85
 
 
86
  /* Copy into output arrays */
 
87
  for (i=0; i<3; i++) {
 
88
    ph[i] = pvh[0][i];
 
89
    vh[i] = pvh[1][i];
 
90
    pb[i] = pvb[0][i];
 
91
    vb[i] = pvb[1][i];
 
92
  }
 
93
 
 
94
}