This page was created by the IDL library routine
mk_html_help
. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: Tue Jan 18 02:08:38 2000.
NAME: CONS_COO PURPOSE: Return a set of X or Y pixel values given an image with astrometry, and either (1) a set of Y OR X pixel values, and a scalar right ascension, or (2) a set of right ascension values, and a scalar Y OR X value. In usage (1), CONS_COO can be used to determine the (X,Y) values of a line of constant right ascension. In usage (2), CONS_COO can used to determine the X positions of specified RA values, along a line of constant Y. CALLING SEQUENCE: X = CONS_COO( COO, xy, h) INPUTS: coo - coordinate value in RADIANS (0 < RA < 2*PI). If Y is a vector, then RA must be a scalar XY - Specified Y pixel value(s) for line of constant right ascension If RA is a vector, then Y must be a scalar CD - 2 x 2 Matrix in RADIANS giving the values of the CD astrometry parameters. CRPIX-2 element vector giving the X and Y coordinates of the reference pixel (exactly as given in a FITS header). CRVAL-2 element vector giving right ascension and declination in RADIANS of the reference pixel. OUTPUTS X - Computed set of X pixel values. The number of elements of X is the maximum of the number of elements of RA and Y. RESTRICTIONS: Program will have difficulty converging for declination values near 90. A tangent projection is assumed REVISION HISTORY: Written, Wayne Landsman STX Co. April, 1988 Algorithm adapted from AIPS memo No. 27 by Eric Griessen
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:cons_coo.pro)
NAME: coo2co PURPOSE: Converts fits-like coordonates description to COBE-like (e.g. 'RA' into 'q') CALLING SEQUENCE: res=coo2co(proj) INPUTS: proj : Fits-like projection type, ie 'RA', 'GLON' or 'ECLON' OUTPUTS res : Dirbe-like projection type, ie 'q','g','e' RESTRICTIONS: None REVISION HISTORY: Bernard J.P., a long time ago
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:coo2co.pro)
NAME: coo2pix2 PURPOSE: converts coordinates to pixels for a certain projection CATEGORY: Coordinates conversions CALLING SEQUENCE: coo2pix2,c1,c2,pixx,pixy[,phi,theta] INPUTS: c1,c2 (coordinates degrees) OPTIONAL INPUT PARAMETERS: OUTPUTS: pixx = x pixel value (IDL format) pixy = y pixel value (IDL format) OPTIONAL OUTPUT PARAMETERS: theta, phi = native spherical coordinates ACCEPTED KEY-WORDS: projection = set to force the proj type (otherwise from common) silent = for the program to be silent lbl = line by line processing, to save memory space COMMON BLOCKS: proj_common.com SIDE EFFECTS: RESTRICTIONS: PROCEDURE: like coo2pix, but performs the calculation on the array at once (not line by line) pixx and pixy are centered at the projection center sxpar,my_ll2uv,my_uv2ll,apply_proj2 EXAMPLES MODIFICATION HISTORY: Written by J.P. Bernard Mar 20 1995 Modified JPB 8/7/99 to use non 2D coordinates arrays
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:coo2pix2.pro)
NAME: cor_proj_cod CATEGORY: JPBLib Coordinates conversions PURPOSE: converts coordinates and projection types into a valid fits ctype CALLING SEQUENCE: cor_proj_cod,coord,proj,ctype1,ctype2,status INPUT: coord : Type of ccordinates proj : type of projection OUTPUT: ctype1 : fits ctype1 sting ctype2 : fits ctype2 sting status : status =0 if OK OPTIONAL INPUT: None INPUT KEYWORDS: None OUTPUT KEYWORDS: None SIDE EFFECTS: None EXAMPLES: cor_proj_cod,'DEC','TAN',ctype1,ctype2,status IDL> print,ctype1,ctype2 DEC--TAN RA---TAN RESTRICTIONS: None PROCEDURES CALLED: None REVISION HISTORY: Created by Bernard Jean-Philippe Jan 31 1995
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:cor_proj_cod.pro)
NAME: cor_proj_dec CATEGORY: JPBLib Coordinates conversions PURPOSE: decodes ctype keyword value into coordinate and projection type CALLING SEQUENCE: cor_proj_dec,ctype,coord,proj,projtype,status,silent=silent INPUTS: ctype = ctype value (e.g. 'RA---TAN') OPTIONAL INPUT PARAMETERS: OUTPUTS: coord = coordinate system (e.g. 'RA') proj = projection (e.g. 'TAN') projtype = projection type (e.g. 'ZEN') status = 1 if OK, 0 otherwise OPTIONAL OUTPUT PARAMETERS: ACCEPTED KEY-WORDS: silent = If set keeps silent COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: Straightforward. Uses : remchar MODIFICATION HISTORY: Written Jan 31 1995 J.P. Bernard, IPAC.
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:cor_proj_dec.pro)
NAME: create_coo2 PURPOSE: CREATE_coo creates coordinates from any fits header CATEGORY: Coordinates conversions CALLING SEQUENCE: CREATE_COO2,H,coo1,coo2 INPUTS: h= the header OPTIONAL INPUT PARAMETERS: OUTPUTS: coo1 = latitude (degrees) coo2 = longitude (degrees) OPTIONAL OUTPUT PARAMETERS: ACCEPTED KEY-WORDS: lbl = line by line processing silent = If set keeps silent remove_edge = if set bad coordinates at edges are set to !indef. Necessary for projections such as GLS, etc .. COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: Creates 1D or 2D arrays of coordinates in a given projection. The parameters are taken from the fits header h, unless specified in keywords (e.g proj). Uses the 3 step procedure described by Greisen & Calabretta (Fits standards). Output coordinates are in degrees, and areas with no coordinates are filled with undefined values (-32768). Longitude increase toward right for cdelt > 0 Currently recognized projection types are: CAR Cartesian GLS Global Sinusoidal MOL Mollweide's AIT Aitoff Uses :sxpar,pix2coo MODIFICATION HISTORY: Written Jan 31 1995 J.P. Bernard, IPAC.
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:create_coo2.pro)
NAME: h2pix PURPOSE: creates pixel array from a header and initialize the projection common CATEGORY: Coordinates conversions CALLING SEQUENCE: pix2coo,h,pixx,pixy,coo1,coo2 INPUTS: h= the header OPTIONAL INPUT PARAMETERS: OUTPUTS: pixx= x pixel value (IDL format) pixy= y pixel value (IDL format) OPTIONAL OUTPUT PARAMETERS: ACCEPTED KEY-WORDS: proj = set to force the proj type (otherwise from header) COMMON BLOCKS: proj_common defined in @proj_common contains: mat,rot,proj,coord,naxis1,naxis2,crpix1,crpix2,projtype SIDE EFFECTS: RESTRICTIONS: PROCEDURE: The pixels values are 0 at the proj center (crpix1,crpix2) The pixel array contains float values. If only h is provided, only the common values are updated If h,pixx are given, pixx is float(Naxis1*Naxis2,2) and the first plane contains x pix values, the second y pix values. If all arguments are provided, pixx and pixy are (Naxis1,Naxis2). uses: sxpar MODIFICATION HISTORY: Written J.P. Bernard Mar 20 1995
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:h2pix.pro)
NAME: make_gsfc_h CALLING SEQUENCE: make_gsfc_h,h PURPOSE: This is to create a header for the 1024*512 images created at GSFC Restricted to the first realease zone: 213:298 (|b|<=15) INPUTS: OPTIONAL INPUT: if FBB if set a header for the reduced image (1024,61) is done allsky = make a all-sky header coord = coordinate system proj = projection type sixpack = makes a 2000 eclipic sixpack cube header tee = makes a 2000 eclipic unfolded Tee header reso = resolution of the cube header (default=9) OUTPUTS: h = header to be created PROCEDURE AND SUBROUTINE USED mkhdr,write_header SIDE EFFECTS: none MODIFICATION HISTORY: written JPB Mon Nov 29 1993 @ IPAC modif JPB Thu Feb 17 1994 @ IPAC to include /FBB and new ctype1 v1.1 modif JPB Fri Jan 27 1995 @ IPAC to put center at proj center added coord and proj keywords changed cdelt, added bunit
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:make_gsfc_h.pro)
NAME: my_CCONV is a shell around pixel to unit vector to lon/lat DESCRIPTION: IDL function that acts as shell around the pixel <--> unit vector, pixel <--> lon/lat, and unit vector <--> lon/lat routines. It is called by COORCONV. CALLING SEQUENCE: output = convert(input,code) ARGUMENTS (I = input, O = output, [] = optional): input I arr Input coordinate array code I int If > 0 then res else uv <--> ll conversion output O [arr] Output coordinate array WARNINGS: There is a C module linkimage by the same name that is a shell around C functions that also perform conversions between pixels and unit vectors and lon/lat. If this linkimage is not implemented then this IDL procedure is compiled and run instead. EXAMPLE: Not user routine # COMMON BLOCKS: None PROCEDURE (AND OTHER PROGRAMMING NOTES): Uses CASE statements to route the input through the proper procedures. PERTINENT ALGORITHMS, LIBRARY CALLS, ETC.: Subroutines called: pix2uv, uv2pix, ll2uv, uv2ll MODIFICATION HISTORY Written by J.M. Gales, Applied Research Corp. Oct 92 Delivered 13-NOV-1992 SPR 10212 SPR 10316 Correct call to UV2LL 07-dec-1992 JM Gales
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:my_cconv.pro)
NAME: my_COORCONV DESCRIPTION: IDL function that acts as shell around the various coordinate conversion routines. It is the program that the user actually calls. Input and output formats are pixel number, decimal hour/latitude, longitude/latitude, and unit vector. CALLING SEQUENCE: outcoor = coorconv(in_coor,infmt=in_fmt,outfmt=out_fmt, $ inco=in_co, outco=out_co) ARGUMENTS (I = input, O = output, [] = optional): in_coor I [arr] Input coordinate array infmt I str Input coordinate format outfmt I str Output coordinate format inco I str Input coord. system or resolution outo I str Output coord. system or resolution out_coor O [arr] Output coordinate array where in_coor & out_coor arrays have the following dimensions for n points: Pixel - input_arr(n) Decimal Hr/deg - input_arr(n,2) lon/lat - input_arr(n,2) Unit vector - input_arr(n,3) infmt & outfmt are specified as follows: Pixel - 'P' Decimal Hr/dec - 'H' Lon/Lat - 'L' Unit vector - 'U' If pixel number is the input format then inco (outco) is specified as follows: Firas (Res 6) - 'F' or 'R6' DMR (Res 6) - 'D' or 'R6' Dirbe (Res 9) - 'B' or 'R9' Resolution m - 'Rm' where m is <= 15 (Note: The default coordinate system for pixels is ecliptic.) otherwise use: Ecliptic - 'E' Galactic - 'G' Equatorial - 'Q' (Epoch 2000) Note: Lower case may also be used. WARNINGS: In order to optimize throughput, this routine does minimal data checking. Improper input such as "unit" vectors with norm not equal to one or pixel numbers with values outside the range defined by the resolution will be processed without crashing, however the output might lead to unexpected results. Therefore it is up to the user to take proper care when generating and/or passing the input. The forward and inverse operations between pixel numbers and pixel unit vector coordinates have been verified up to and including resolution 12. (The forward procedure is based on the forward_cube.for program in the upx directory.) EXAMPLE: To convert an array of sky coordinates in 'L' format from ecliptic coordinates to an array in 'U' format in galactic coordinates: output = coorconv(input,infmt='L',outfmt='U',inco='E',outco='G') To convert an array of sky coordinates in 'L' format to an array in 'U' format without changing coordinate systems: output = coorconv(input,infmt='L',outfmt='U') To convert an array of sky coordinates in 'H' format in equatorial coordinates to an array of Firas pixel numbers: output = coorconv(input,infmt='H',outfmt='P',inco='Q',outco='F') or output = coorconv(input,infmt='H',outfmt='P',inco='Q',outco='R7') To convert an array of resolution 8 pixel numbers to sky coordinates in 'L' format in galactic coordinates: output = coorconv(input,infmt='P',outfmt='L',inco='R8',outco='G') To convert an array of Dirbe pixel numbers to an array of DMR pixels: output = coorconv(input,infmt='P',outfmt='p',inco='P',outco='D') Note: You cannot "up res" pixel numbers from a lower resolution to a higher one. # COMMON BLOCKS: sky_conv_com PROCEDURE (AND OTHER PROGRAMMING NOTES): Uses CASE statements to route the input through the proper procedures. PERTINENT ALGORITHMS, LIBRARY CALLS, ETC.: Subroutines called: loadsky, skyconv, cconv MODIFICATION HISTORY Written by J.M. Gales, Applied Research Corp. Mar 92 SPR 9741 Change PRINT statements to MESSAGE statements in error situations. 2 JUN 1992 SER 9984 Implement cconv (c module for p <-> uv <-> ll conversions) 9-SEP-1992 JMG SPR 10212 Generate conversions in call to CCONV module Note: New CCONV exists as both IDL procedure and C module. 13-NOV-1992 JMG SPR 10318 Fix problem with scalar pixel entry 07-DEC-1992 JMG SPR 10348 Fix problem with integer format lon/lat and RA/dec input Fix incorrect arithmetic in lon/lat <=> RA/dec conversion 14-DEC-1992 JMG SPR 10842 Fix problem with conversion of long integers to short int 28-SEP-1993 JMG .TITLE Routine COORCONV
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:my_coorconv.pro)
NAME: pix2coo2 PURPOSE: converts pixels to coordinates given projection parameters CATEGORY: Coordinates conversions CALLING SEQUENCE: pix2coo2,pixx,pixy,coo1,coo2 INPUTS: pixx= x pixel value (IDL format) pixy= y pixel value (IDL format) OPTIONAL INPUT PARAMETERS: OUTPUTS: coo1,coo2 (degrees) OPTIONAL OUTPUT PARAMETERS: ACCEPTED KEY-WORDS: projection= set to force the proj type (otherwise from proj_common) silent = for the program to be silent lbl = line by line (to avoid out of memory pbs) COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: sxpar, apply_proj2, my_uv2ll, my_ll2uv MODIFICATION HISTORY: Written by J.P. Bernard Mar 20 1995 Modified JPB 8/7/99 to use non 2D coordinates arrays
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:pix2coo2.pro)
NAME: WCSXY2SPH PURPOSE: To convert x and y (map) coordinates to spherical (longitude and latitude or sky) coordinates. This procedure is the inverse of WCSSPH2XY. CATEGORY: Mapping and Auxilliary 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 OPTIONAL 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 sytem ('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 NOTES: The conventions followed here are ; in FITS" by Eric Greisen and Mark Calabretta (draft dated August 16, 1994). 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 CALLED: WCS_ROTATE COPYRIGHT NOTICE: 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 MODIFICATIONS/REVISION LEVEL: 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 Adapted from above to include theta, phi Kwords J.P. Bernard.
(See MacintoshHD:IDL Libraries:JPBlib:Coordinates:my_wcsxy2sph.pro)