| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
/* |
|
2
|
|
|
|
|
|
|
*+ |
|
3
|
|
|
|
|
|
|
* Name: |
|
4
|
|
|
|
|
|
|
* palPrenut |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
* Purpose: |
|
7
|
|
|
|
|
|
|
* Form the matrix of bias-precession-nutation (IAU 2006/2000A) |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
* Language: |
|
10
|
|
|
|
|
|
|
* Starlink ANSI C |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
* Type of Module: |
|
13
|
|
|
|
|
|
|
* Library routine |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
* Invocation: |
|
16
|
|
|
|
|
|
|
* void palPrenut( double epoch, double date, double rmatpn[3][3] ) |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
* Arguments: |
|
19
|
|
|
|
|
|
|
* epoch = double (Returned) |
|
20
|
|
|
|
|
|
|
* Julian epoch for mean coordinates. |
|
21
|
|
|
|
|
|
|
* date = double (Returned) |
|
22
|
|
|
|
|
|
|
* Modified Julian Date (JD-2400000.5) for true coordinates. |
|
23
|
|
|
|
|
|
|
* rmatpn = double[3][3] (Returned) |
|
24
|
|
|
|
|
|
|
* combined NPB matrix |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
* Description: |
|
27
|
|
|
|
|
|
|
* Form the matrix of bias-precession-nutation (IAU 2006/2000A). |
|
28
|
|
|
|
|
|
|
* The epoch and date are TT (but TDB is usually close enough). |
|
29
|
|
|
|
|
|
|
* The matrix is in the sense v(true) = rmatpn * v(mean). |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
* Authors: |
|
32
|
|
|
|
|
|
|
* PTW: Pat Wallace (STFC) |
|
33
|
|
|
|
|
|
|
* {enter_new_authors_here} |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
* History: |
|
36
|
|
|
|
|
|
|
* 2012-02-10 (PTW): |
|
37
|
|
|
|
|
|
|
* Initial version. |
|
38
|
|
|
|
|
|
|
* Adapted with permission from the Fortran SLALIB library. |
|
39
|
|
|
|
|
|
|
* {enter_further_changes_here} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
* Copyright: |
|
42
|
|
|
|
|
|
|
* Copyright (C) 2012 Science and Technology Facilities Council. |
|
43
|
|
|
|
|
|
|
* All Rights Reserved. |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
* Licence: |
|
46
|
|
|
|
|
|
|
* This program is free software: you can redistribute it and/or |
|
47
|
|
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public |
|
48
|
|
|
|
|
|
|
* License as published by the Free Software Foundation, either |
|
49
|
|
|
|
|
|
|
* version 3 of the License, or (at your option) any later |
|
50
|
|
|
|
|
|
|
* version. |
|
51
|
|
|
|
|
|
|
* |
|
52
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful, |
|
53
|
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
54
|
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
55
|
|
|
|
|
|
|
* GNU Lesser General Public License for more details. |
|
56
|
|
|
|
|
|
|
* |
|
57
|
|
|
|
|
|
|
* You should have received a copy of the GNU Lesser General |
|
58
|
|
|
|
|
|
|
* License along with this program. If not, see |
|
59
|
|
|
|
|
|
|
* . |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
* Bugs: |
|
62
|
|
|
|
|
|
|
* {note_any_bugs_here} |
|
63
|
|
|
|
|
|
|
*- |
|
64
|
|
|
|
|
|
|
*/ |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#include "pal.h" |
|
67
|
|
|
|
|
|
|
#include "palmac.h" |
|
68
|
|
|
|
|
|
|
#include "pal1sofa.h" |
|
69
|
|
|
|
|
|
|
|
|
70
|
10
|
|
|
|
|
|
void palPrenut ( double epoch, double date, double rmatpn[3][3] ){ |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
/* Local Variables: */ |
|
73
|
|
|
|
|
|
|
double bpa; |
|
74
|
|
|
|
|
|
|
double bpia; |
|
75
|
|
|
|
|
|
|
double bqa; |
|
76
|
|
|
|
|
|
|
double chia; |
|
77
|
|
|
|
|
|
|
double d1; |
|
78
|
|
|
|
|
|
|
double d2; |
|
79
|
|
|
|
|
|
|
double eps0; |
|
80
|
|
|
|
|
|
|
double epsa; |
|
81
|
|
|
|
|
|
|
double gam; |
|
82
|
|
|
|
|
|
|
double oma; |
|
83
|
|
|
|
|
|
|
double pa; |
|
84
|
|
|
|
|
|
|
double phi; |
|
85
|
|
|
|
|
|
|
double pia; |
|
86
|
|
|
|
|
|
|
double psi; |
|
87
|
|
|
|
|
|
|
double psia; |
|
88
|
|
|
|
|
|
|
double r1[3][3]; |
|
89
|
|
|
|
|
|
|
double r2[3][3]; |
|
90
|
|
|
|
|
|
|
double thetaa; |
|
91
|
|
|
|
|
|
|
double za; |
|
92
|
|
|
|
|
|
|
double zetaa; |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
/* Specified Julian epoch as a 2-part JD. */ |
|
95
|
10
|
|
|
|
|
|
eraEpj2jd( epoch, &d1, &d2 ); |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
/* P matrix, from specified epoch to J2000.0. */ |
|
98
|
10
|
|
|
|
|
|
eraP06e( d1, d2, &eps0, &psia, &oma, &bpa, &bqa, &pia, &bpia, &epsa, |
|
99
|
|
|
|
|
|
|
&chia, &za, &zetaa, &thetaa, &pa, &gam, &phi, &psi ); |
|
100
|
10
|
|
|
|
|
|
eraIr( r1 ); |
|
101
|
10
|
|
|
|
|
|
eraRz( -chia, r1 ); |
|
102
|
10
|
|
|
|
|
|
eraRx( oma, r1 ); |
|
103
|
10
|
|
|
|
|
|
eraRz( psia, r1 ); |
|
104
|
10
|
|
|
|
|
|
eraRx( -eps0, r1 ); |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
/* NPB matrix, from J2000.0 to date. */ |
|
107
|
10
|
|
|
|
|
|
eraPnm06a( PAL__MJD0, date, r2 ); |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
/* NPB matrix, from specified epoch to date. */ |
|
110
|
10
|
|
|
|
|
|
eraRxr( r2, r1, rmatpn ); |
|
111
|
10
|
|
|
|
|
|
} |