~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to libsrc/astro/ast_jgal.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)ast_jgal.c       19.1 (ES0-DMD) 02/25/03 13:53:53 */
 
2
/*===========================================================================
 
3
  Copyright (C) 1995 European Southern Observatory (ESO)
 
4
 
 
5
  This program is free software; you can redistribute it and/or 
 
6
  modify it under the terms of the GNU General Public License as 
 
7
  published by the Free Software Foundation; either version 2 of 
 
8
  the License, or (at your option) any later version.
 
9
 
 
10
  This program is distributed in the hope that it will be useful,
 
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
  GNU General Public License for more details.
 
14
 
 
15
  You should have received a copy of the GNU General Public 
 
16
  License along with this program; if not, write to the Free 
 
17
  Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
  MA 02139, USA.
 
19
 
 
20
  Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
        Internet e-mail: midas@eso.org
 
22
        Postal address: European Southern Observatory
 
23
                        Data Management Division 
 
24
                        Karl-Schwarzschild-Strasse 2
 
25
                        D 85748 Garching bei Muenchen 
 
26
                        GERMANY
 
27
===========================================================================*/
 
28
 
 
29
/*+++++++++++++
 
30
.TYPE           Module
 
31
.IDENTIFICATION jgal.c
 
32
.VERSION 1.0    27-Feb-1987: Creation
 
33
.VERSION 1.1    24-Oct-1988: Applies on Unit Vectors
 
34
.Language       C
 
35
.AUTHOR         Francois Ochsenbein [ESO-IPG]  
 
36
.KEYWORDS       J2000 / Galactic coordinate transformations
 
37
 
 
38
.ENV            
 
39
 
 
40
.COMMENTS
 
41
All spherical coordinates are assumed to be expressed in DEGREES.
 
42
No function is traced.
 
43
 
 
44
\begin{TeX}
 
45
 
 
46
The parameter mnemonics are:
 
47
 
 
48
\begin{itemize}
 
49
 \item f = array $[\alpha,\delta]$ of  Fundamental (J2000) equatorial coordinates 
 
50
 \item g = array $[\ell,b]$    of  Galactic   coordinates
 
51
\end{itemize}
 
52
\end{TeX}
 
53
 
 
54
-----------------------------------------------------------------------*/
 
55
 
 
56
 
 
57
#include <math.h>
 
58
#include <osdefos.h>
 
59
 
 
60
#define DEBUG           0       /* Debugging option     */
 
61
 
 
62
 
 
63
RGLOBAL double gal_2000[3][3] = {       /* J2000 to galactic rotation matrix */
 
64
        {-0.054875539726e0, -0.873437108010e0, -0.483834985808e0},
 
65
        { 0.494109453312e0, -0.444829589425e0,  0.746982251810e0},
 
66
        {-0.867666135858e0, -0.198076386122e0,  0.455983795705e0}
 
67
        };
 
68
 
 
69
/*============================================================================*/
 
70
int tr_f5g (uf5 , ug)  
 
71
/*+++
 
72
.PURPOSE   transformation from J2000 to Galactic 
 
73
.RETURNS   OK
 
74
---*/
 
75
        double uf5[3];  /* IN: J2000 Unit Vector */
 
76
        double ug[3];   /* OUT: Galactic Unit Vector */
 
77
 
78
  return (tr_uu ( uf5, ug, gal_2000));
 
79
}
 
80
 
 
81
/*============================================================================*/
 
82
int tr_gf5 (ug , uf5)  
 
83
/*+++   
 
84
.PURPOSE  transformation from Galactic to J2000
 
85
.RETURNS  OK
 
86
---*/
 
87
        double ug[3];   /* IN: Galactic Unit Vector     */
 
88
        double uf5[3];   /* OUT: J2000 Unit Vector      */
 
89
 
90
  return (tr_uu1 ( ug, uf5, gal_2000));
 
91
}
 
92