idlastro / FITS Astrometry and Calibration: WCS_GETPOLE

[Source code]

NAME
WCS_GETPOLE 
PURPOSE
Compute the coordinates of the native pole
EXPLANATION
WCS_GETPOLE is used to determine the celestial position of the 
native pole.    See section 2.4 of the paper 
"Representation of Celestial Coordinates in FITS" by Calabretta 
Greisen (2002, A&A, 395, 1077, also available at  
http://fits.gsfc.nasa.gov/fits_wcs.html    Called by WCS_ROTATE
CALLING SEQUENCE
WCS_GETPOLE, crval, lonpole, theta0, alpha_p, delta_p, [LATPOLE= AT_POLE=]
INPUT PARAMETERS
crval - 2 element vector containing standard system coordinates (the 
        longitude and latitude) of the reference point in degrees
lonpole - native longitude of the celestial North Pole (degrees)
          *unless* the fiducial point is at non-zero native longitude
          (phi_0 =/ 0), in which case phi_0 should have been subtracted,
          i.e. lonpole = phi_p - phi_0.
theta0  - native latitude of the fiducial point (degrees)
OUTPUT PARAMETERS
alpha_p, delta_p - celestial longitude and latitude of the native pole
        (Radians)
OPTIONAL KEYWORD INPUT PARAMETERS
LATPOLE - native latitude of the celestial North Pole (degrees)
          NB only used to resolve ambiguity. Final value is the one 
          nearest to input value of LATPOLE. Can be set outside range
          [-90,90]
OPTIONAL KEYWORD OUTPUT PARAMETERS
AT_POLE (byte) true if delta_p = pi/2 (avoiding some round-off errors)
REVISION HISTORY
Written    W. Landsman               June, 2003
Fix calculation when theta0 is not 0 or 90     February 2004
E. Hivon: alpha_p, delta_p consistenly in Radians May 2010
J. P. Leahy introduced AT_POLE, more traps for special cases to
avoid rounding errors                July 2013