[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


WCSXY2SPH Source code in wcsxy2sph.pro

WCSXY2SPH

Name
      WCSXY2SPH
Purpose
      Convert x and y (map) coordinates to spherical coordinates
Explanation
      To convert x and y (map) coordinates to spherical (longitude and
      latitude or sky) coordinates.    This procedure is the inverse of
      WCSSPH2XY.
     This is a lower level procedure -- given a FITS header, the user will
     usually use XYAD which will then call WCSXY2SPH with the appropriate
     parameters.
Category
      Mapping and Auxilary FITS Routine
Calling Sequence
      wcsxy2sph, x, y, longitude, latitude, [map_type], [ CTYPE = ,$
             FACE = ,PROJP1 = , PROJP2 = ,CRVAL =, CRXY =, LONGPOLE= ]
Input Parameters
       x - x coordinate of data, scalar or vector, in degrees, NOTE: x
               increases to to the left, not the right
       y - y coordinate of data, same number of elements as x, in degrees
       map_type - optional positional parameter, scalar corresponding to a
               particular map projection.  This is not a FITS standard, it is
               simply put in to allow function similar to that of less general
               map projection procedures (eg AITOFF).  The following list gives
               the map projection types and their respective numbers.
  FITS  Number  Name                       Comments
  code   code
  ----  ------  -----------------------    -----------------------------------
   DEF     0    Default = Cartesian
   AZP     1    Zenithal perspective       projp1 required
   TAN     2    Gnomic                     AZP w/ projp1 = 0
   SIN     3    Orthographic               AZP w/ projp1 = Infinity (>10^14)
   STG     4    Stereographic              AZP w/ projp1 = 1
   ARC     5    Zenithal Equidistant
   ZPN     6    Zenithal polynomial        prop1-projp9 required, useless
   ZEA     7    Zenithal equal area
   AIR     8    Airy                       projp1 required
   CYP     9    Cylindrical perspective    projp1 and projp2 required
   CAR    10    Cartesian
   MER    11    Mercator
   CEA    12    Cylindrical equal area     projp1 required
   COP    13    Conical perspective        projp1 and projp2 required
   COD    14    Conical equidistant        projp1 and projp2 required
   COE    15    Conical equal area         projp1 and projp2 required
   COO    16    Conical orthomorphic       projp1 and projp2 required
   BON    17    Bonne's equal area         projp1 required
   PCO    18    Polyconic
   GLS    19    Sinusoidal
   PAR    20    Parabolic
   AIT    21    Hammer-Aitoff
   MOL    22    Mollweide
   CSC    23    Cobe Quadrilateralized     inverse converges poorly
                Spherical Cube
   QCS    24    Quadrilateralized
                Spherical Cube
   TSC    25    Tangential Spherical Cube
Keyword Parameters
       CTYPE - One, two, or three element vector containing 8 character
               strings corresponding to the CTYPE1, CTYPE2, and CTYPE3
               FITS keywords:
               CTYPE[0] - first four characters specify standard system
               ('RA--','GLON' or 'ELON' for right ascension, galactic
               longitude or ecliptic longitude respectively), second four
               letters specify the type of map projection (eg '-AIT' for
               Aitoff projection)
               CTYPE[1] - first four characters specify standard system
               ('DEC-','GLAT' or 'ELAT' for declination, galactic latitude
               or ecliptic latitude respectively; these must match
               the appropriate system of ctype1), second four letters of
               ctype2 must match second four letters of ctype1.
               CTYPE[2] - if present must be the 8 character string,'CUBEFACE',
                only used for spherical cube projections to identify an axis
               as containing the face on which each x and y pair of
               coordinates lie.
       FACE - a input variable used for spherical cube projections to
               designate the face of the cube on which the x and y
               coordinates lie.   Must contain the same number of elements
               as X and Y.
       CRVAL - 2 element vector containing standard system coordinates (the
               longitude and latitude) of the reference point
       CRXY - 2 element vector giving the x and y coordinates of the
               reference point, if this is not set the offset of the x
               coordinate is assumed to be 0.
       LONGPOLE - native longitude of standard system's North Pole, default
               is 180 degrees, numeric scalar
       PROJP1 - scalar with first projection parameter, this may
               or may not be necessary depending on the map projection used
       PROJP2 - scalar with second projection parameter, this may
               or may not be necessary depending on the map projection used
Output Parameters
       longitude - longitude of data, same number of elements as x, in degrees
       latitude - latitude of data, same number of elements as x, in degrees
Note
       The conventions followed here are described in more detail in the paper
      "Representations of Celestial Coordinates in FITS" by Calabretta &
       Greisen (2002, A&A, 395, 1077, also see
       http://www.aoc.nrao.edu/~egreisen).   The general scheme
       outlined in that article is to convert x and y coordinates into a
       "native" longitude and latitude and then rotate the system into one of
       three generally recognized systems (celestial, galactic or ecliptic).
       This procedure necessitates two basic sections.  The first converts
       x and y coordinates to "native" coordinates while the second converts
       "native" to "standard" coordinates.  The first section contains the
       guts of the code in which all of the map projection is done.  The
       second step is performed by WCS_ROTATE and only involves rotation of
       coordinate systems.  WCSXY2SPH can be called in a form similar to
       AITOFF, EQPOLE, or QDCB by calling wcsxy2sph with a fifth parameter
       specifying the map projection by number and by not using any of the
       keywords related to the map projection type (eg ctype1 and ctyp2).
Procedure
       The first task of the procedure is to do general error-checking to
       make sure the procedure was called correctly and none of the
       parameters or keywords conflict.  This is particularly important
       because the procedure can be called in two ways (either using
       FITS-type keywords or using a number corresponding a map projection
       type).  All variables are converted into double precision values.
       The second task of the procedure is to take x and y coordinates and
       convert them into "native" latitude and longitude coordinates.
       Map-specific error-checking is done at this time.  All of the
       equations were obtained from "Representations of Celestial
       Coordinates in FITS" and cases needing special attention are handled
       appropriately (see the comments with individual map projections for
       more information on special cases).     WCS_ROTATE is then called to
       convert the "native" coordinates to "standard" coordinates by rotating
       the coordinate system.  This rotation is governed by the keywords
       CRVAL, and LONGPOLE.  The transformation is a straightforward
       application of euler angles.  Finally, longitude values are converted
       into the range from 0 to 360 degrees.
Common Blocks
       none
Procedures Used
       WCS_ROTATE
Copyright
       Copyright 1991, The Regents of the University of California. This
       software was produced under U.S. Government contract (W-7405-ENG-36)
       by Los Alamos National Laboratory, which is operated by the
       University of California for the U.S. Department of Energy.
       The U.S. Government is licensed to use, reproduce, and distribute
       this software. Neither the Government nor the University makes
       any warranty, express or implied, or assumes any liability or
       responsibility for the use of this software.
Author
       Rick Balsano
Revision History
 1.1    8/31/93
 1.2    9/12/93   W. Landsman Vectorized CRXY, CRVAL, CTYPE
 1.3    29/12/93  I. Freedman Eliminated LU decomposition
 1.4    22/09/94  W. Landsman If scalar input, then scalar output
 1.5    02/03/05  W. Landsman Change variable name BETA for V4.0 compatibility
 1.6    06/07/05  W. Landsman Change loop index from integer to long
       Converted to IDL V5.0   W. Landsman   September 1997
 1.7    02/18/99  W. Landsman Fixed implementation of ARC algorithm

Last modified by pro2html on 2003 April 26 at 03:35 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically