FACT++  1.0
palGe50.c
Go to the documentation of this file.
1 /*
2 *+
3 * Name:
4 * palGe50
5 
6 * Purpose:
7 * Transform Galactic Coordinate to B1950 FK4
8 
9 * Language:
10 * Starlink ANSI C
11 
12 * Type of Module:
13 * Library routine
14 
15 * Invocation:
16 * palGe50( double dl, double db, double *dr, double *dd );
17 
18 * Arguments:
19 * dl = double (Given)
20 * Galactic longitude (radians)
21 * db = double (Given)
22 * Galactic latitude (radians)
23 * dr = double * (Returned)
24 * B9150.0 FK4 RA.
25 * dd = double * (Returned)
26 * B1950.0 FK4 Dec.
27 
28 * Description:
29 * Transformation from IAU 1958 galactic coordinates to
30 * B1950.0 'FK4' equatorial coordinates.
31 
32 * Authors:
33 * PTW: Patrick T. Wallace
34 * TIMJ: Tim Jenness (JAC, Hawaii)
35 * {enter_new_authors_here}
36 
37 * Notes:
38 * - The equatorial coordinates are B1950.0 'FK4'. Use the routine
39 * palGaleq if conversion to J2000.0 coordinates is required.
40 
41 * See Also:
42 * - Blaauw et al, Mon.Not.R.Astron.Soc.,121,123 (1960)
43 
44 * History:
45 * 2012-03-23 (TIMJ):
46 * Initial version
47 * Adapted with permission from the Fortran SLALIB library.
48 * {enter_further_changes_here}
49 
50 * Copyright:
51 * Copyright (C) 1995 Rutherford Appleton Laboratory
52 * Copyright (C) 2012 Science and Technology Facilities Council.
53 * All Rights Reserved.
54 
55 * Licence:
56 * This program is free software; you can redistribute it and/or
57 * modify it under the terms of the GNU General Public License as
58 * published by the Free Software Foundation; either version 3 of
59 * the License, or (at your option) any later version.
60 *
61 * This program is distributed in the hope that it will be
62 * useful, but WITHOUT ANY WARRANTY; without even the implied
63 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
64 * PURPOSE. See the GNU General Public License for more details.
65 *
66 * You should have received a copy of the GNU General Public License
67 * along with this program; if not, write to the Free Software
68 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
69 * MA 02110-1301, USA.
70 
71 * Bugs:
72 * {note_any_bugs_here}
73 *-
74 */
75 
76 #include "pal.h"
77 #include "pal1sofa.h"
78 
79 void palGe50 ( double dl, double db, double * dr, double * dd ) {
80 
81 /*
82  * L2,B2 system of galactic coordinates
83  *
84  * P = 192.25 RA of galactic north pole (mean B1950.0)
85  * Q = 62.6 inclination of galactic to mean B1950.0 equator
86  * R = 33 longitude of ascending node
87  *
88  * P,Q,R are degrees
89  *
90  *
91  * Equatorial to galactic rotation matrix
92  *
93  * The Euler angles are P, Q, 90-R, about the z then y then
94  * z axes.
95  *
96  * +CP.CQ.SR-SP.CR +SP.CQ.SR+CP.CR -SQ.SR
97  *
98  * -CP.CQ.CR-SP.SR -SP.CQ.CR+CP.SR +SQ.CR
99  *
100  * +CP.SQ +SP.SQ +CQ
101  *
102  */
103 
104  double rmat[3][3] = {
105  { -0.066988739415,-0.872755765852,-0.483538914632 },
106  { +0.492728466075,-0.450346958020,+0.744584633283 },
107  { -0.867600811151,-0.188374601723,+0.460199784784 }
108  };
109 
110  double v1[3], v2[3], r, d, re, de;
111 
112  /* Spherical to cartesian */
113  eraS2c( dl, db, v1 );
114 
115  /* Rotate to mean B1950.0 */
116  eraTrxp( rmat, v1, v2 );
117 
118  /* Cartesian to spherical */
119  eraC2s( v2, &r, &d );
120 
121  /* Introduce E-terms */
122  palAddet( r, d, 1950.0, &re, &de );
123 
124  /* Express in conventional ranges */
125  *dr = eraAnp( re );
126  *dd = eraAnpm( de );
127 
128 }
void eraS2c(double theta, double phi, double c[3])
Definition: s2c.c:3
void palAddet(double rm, double dm, double eq, double *rc, double *dc)
Definition: palAddet.c:88
void eraC2s(double p[3], double *theta, double *phi)
Definition: c2s.c:3
void eraTrxp(double r[3][3], double p[3], double trp[3])
Definition: trxp.c:3
double eraAnpm(double a)
Definition: anpm.c:3
double eraAnp(double a)
Definition: anp.c:3
void palGe50(double dl, double db, double *dr, double *dd)
Definition: palGe50.c:79