source: branches/FACT++_part_filenames/pal/palEvp.c

Last change on this file was 18347, checked in by tbretz, 9 years ago
File size: 3.1 KB
Line 
1/*
2*+
3* Name:
4* palEvp
5
6* Purpose:
7* Returns the barycentric and heliocentric velocity and position of the
8* Earth.
9
10* Language:
11* Starlink ANSI C
12
13* Type of Module:
14* Library routine
15
16* Invocation:
17* void palEvp( double date, double deqx, double dvb[3], double dpb[3],
18* double dvh[3], double dph[3] )
19
20* Arguments:
21* date = double (Given)
22* TDB (loosely ET) as a Modified Julian Date (JD-2400000.5)
23* deqx = double (Given)
24* Julian epoch (e.g. 2000.0) of mean equator and equinox of the
25* vectors returned. If deqx <= 0.0, all vectors are referred to the
26* mean equator and equinox (FK5) of epoch date.
27* dvb = double[3] (Returned)
28* Barycentric velocity (AU/s, AU)
29* dpb = double[3] (Returned)
30* Barycentric position (AU/s, AU)
31* dvh = double[3] (Returned)
32* heliocentric velocity (AU/s, AU)
33* dph = double[3] (Returned)
34* Heliocentric position (AU/s, AU)
35
36* Description:
37* Returns the barycentric and heliocentric velocity and position of the
38* Earth at a given epoch, given with respect to a specified equinox.
39* For information about accuracy, see the function eraEpv00.
40
41* Authors:
42* PTW: Pat Wallace (STFC)
43* {enter_new_authors_here}
44
45* History:
46* 2012-02-13 (PTW):
47* Initial version.
48* Adapted with permission from the Fortran SLALIB library.
49* {enter_further_changes_here}
50
51* Copyright:
52* Copyright (C) 2005 Patrick T. Wallace
53* Copyright (C) 2012 Science and Technology Facilities Council.
54* All Rights Reserved.
55
56* Licence:
57* This program is free software: you can redistribute it and/or
58* modify it under the terms of the GNU Lesser General Public
59* License as published by the Free Software Foundation, either
60* version 3 of the License, or (at your option) any later
61* version.
62*
63* This program is distributed in the hope that it will be useful,
64* but WITHOUT ANY WARRANTY; without even the implied warranty of
65* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66* GNU Lesser General Public License for more details.
67*
68* You should have received a copy of the GNU Lesser General
69* License along with this program. If not, see
70* <http://www.gnu.org/licenses/>.
71
72* Bugs:
73* {note_any_bugs_here}
74*-
75*/
76
77#include "pal.h"
78#include "palmac.h"
79#include "pal1sofa.h"
80
81void palEvp( double date, double deqx, double dvb[3], double dpb[3],
82 double dvh[3], double dph[3] ){
83
84/* Local Variables; */
85 int i;
86 double pvh[2][3], pvb[2][3], d1, d2, r[3][3];
87
88/* BCRS PV-vectors. */
89 eraEpv00 ( 2400000.5, date, pvh, pvb );
90
91/* Was precession to another equinox requested? */
92 if ( deqx > 0.0 ) {
93
94/* Yes: compute precession matrix from J2000.0 to deqx. */
95 eraEpj2jd ( deqx, &d1, &d2 );
96 eraPmat06 ( d1, d2, r );
97
98/* Rotate the PV-vectors. */
99 eraRxpv ( r, pvh, pvh );
100 eraRxpv ( r, pvb, pvb );
101 }
102
103/* Return the required vectors. */
104 for ( i = 0; i < 3; i++ ) {
105 dvh[i] = pvh[1][i] / PAL__SPD;
106 dvb[i] = pvb[1][i] / PAL__SPD;
107 dph[i] = pvh[0][i];
108 dpb[i] = pvb[0][i];
109 }
110}
Note: See TracBrowser for help on using the repository browser.