| 
 
      Convert from FPC to World (celestial) coordinates by applying an aspect solution.
     
Array_Type pix_dmTanPixToWorld( Array_Type pix, Array_Type asp,
Array_Type crpix, Array_Type cdelt ) 
      
        This routine converts a position in the Focal Plane coordinate
        (FPC) system to the World (Celestial) coordinate system.
        To perform this conversion the routine needs to know the
        aspect solution, knowledge of where the telescope
        was pointing at the time the photon was detected.
	The FPC system corresponds 
	to the ( DETX, DETY ) columns of a Chandra event file.
       
	The position, in the FPC system, is given by the
	two-element array pix, which has units of pixels.
	The pointing position is given in the three-element
	array asp, which should contain the
	ra, dec, and roll values in degrees.
	The crpix argument is a two-element array which gives
	the pixel location for the aimpoint.
	The cdelt argument is also a two-argument
	array and gives the pixel size
	in degrees. For the ACIS detectors you would use
	 crpix = [ 4096.5, 4096.5 ]cdelt = [ -0.492, 0.492 ] / 3600.0
        The return value is a two-element array which gives the
        World coordinates in degrees.
       
chips> require("pixlib")
chips> pix_init_pixlib
chips> evt = readfile( "acis_evt2.fits" )
chips> asol = readfile( "acis_asol.fits" )
chips> detpos = [ evt.detx[0], evt.dety[0] ]
chips> asp = [ asol.ra[0], asol.dec[0], asol.roll[0] ]
chips> crpix = [ 4096.5, 4096.5 ]
chips> crdelt = [ -0.492, 0.492 ] / 3600
chips> wcspos = pix_dmTanPixToWorld( detpos, asp, crpix, crdelt )
	  
	    In this example we have used the pix_dmTanPixToWorld() routine
	    to convert the detector position of the first event
	    in acis_evt2.fits into WCS (RA, Dec) values using the
	    first element of the aspect solution.
	    In reality you would want to use the aspect solution that
	    was valid at the time the event was detected - which can
	    be found since both files have a time column - rather than
	    using an aritrary value as we did here.
	   |