idlastro / Astronomical Utilities: EULER

[Source code]

NAME
EULER
PURPOSE
Transform between Galactic, celestial, and ecliptic coordinates.
EXPLANATION
Use the procedure ASTRO to use this routine interactively
CALLING SEQUENCE
EULER, AI, BI, AO, BO, [ SELECT, /FK4, /RADIAN, SELECT = ] 
INPUTS
AI - Input Longitude, scalar or vector.  In DEGREES unless /RADIAN
     is set.  If only two parameters are supplied, then  AI and BI 
      will be modified to contain the output longitude and latitude.
BI - Input Latitude in DEGREES
OPTIONAL INPUT
SELECT - Integer (1-6) specifying type of coordinate transformation.  
ELECT   From          To        |   SELECT      From            To
1     RA-Dec (2000)  Galactic   |     4       Ecliptic      RA-Dec    
2     Galactic       RA-DEC     |     5       Ecliptic      Galactic  
3     RA-Dec         Ecliptic   |     6       Galactic      Ecliptic  
f not supplied as a parameter or keyword, then EULER will prompt for 
he value of SELECT
elestial coordinates (RA, Dec) should be given in equinox J2000 
nless the /FK4 keyword is set.
OUTPUTS
AO - Output Longitude in DEGREES, always double precision
BO - Output Latitude in DEGREES, always double precision
OPTIONAL INPUT KEYWORD
/FK4 - If this keyword is set and non-zero, then input and output 
      celestial and ecliptic coordinates should be given in equinox 
      B1950.
/RADIAN - if set, then all input and output angles are in radians rather
      than degrees.
SELECT  - The coordinate conversion integer (1-6) may alternatively be 
       specified as a keyword
EXAMPLE
Find the Galactic coordinates of Cyg X-1 (ra=299.590315, dec=35.201604)
IDL> ra = 299.590315d
IDL> dec = 35.201604d
IDL> euler,ra,dec,glong,glat,1 & print,glong,glat 
     71.334990, 3.0668335
REVISION HISTORY
Written W. Landsman,  February 1987
Adapted from Fortran by Daryl Yentis NRL
Made J2000 the default, added /FK4 keyword  W. Landsman December 1998
Add option to specify SELECT as a keyword W. Landsman March 2003
Use less virtual memory for large input arrays W. Landsman June 2008
Added /RADIAN input keyword  W. Landsman   Sep 2008