source: trunk/FACT++/pal/palPrenut.c

Last change on this file was 18347, checked in by tbretz, 9 years ago
File size: 2.8 KB
Line 
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* <http://www.gnu.org/licenses/>.
60
61* Bugs:
62* {note_any_bugs_here}
63*-
64*/
65
66#include "pal.h"
67#include "palmac.h"
68#include "pal1sofa.h"
69
70void 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 eraEpj2jd( epoch, &d1, &d2 );
96
97/* P matrix, from specified epoch to J2000.0. */
98 eraP06e( d1, d2, &eps0, &psia, &oma, &bpa, &bqa, &pia, &bpia, &epsa,
99 &chia, &za, &zetaa, &thetaa, &pa, &gam, &phi, &psi );
100 eraIr( r1 );
101 eraRz( -chia, r1 );
102 eraRx( oma, r1 );
103 eraRz( psia, r1 );
104 eraRx( -eps0, r1 );
105
106/* NPB matrix, from J2000.0 to date. */
107 eraPnm06a( PAL__MJD0, date, r2 );
108
109/* NPB matrix, from specified epoch to date. */
110 eraRxr( r2, r1, rmatpn );
111}
Note: See TracBrowser for help on using the repository browser.