Skip to the navigation links
Last modified: December 2009

AHELP for CIAO 4.2


Context: pixlib


Convert from World (celestial) to FPC coordinates by applying an aspect solution.


Array_Type pix_dmTanWorldToPix( Array_Type world, Array_Type asp,
Array_Type crpix, Array_Type cdelt )


This routine converts a position in the World (Celestial) coordinate system to the Focal Plane coordinate (FPC) 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 world position (the world argument) is given as a two-element array in units of degrees. 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 FPC coordinates in pixels.

The pixlib module is not available by default; to use it in a S-Lang program, it must be loaded using the S-Lang require() function:



slsh> require("pixlib");
slsh> require("paramio");
slsh> pix_init_pixlib;
slsh> wcspos = [ evt.RA[0], evt.DEC[0] ];
slsh> !dmkeypar acis_evt2.fits ra_nom;
slsh> ra_nom = pget( "dmkeypar", "value" );
slsh> !dmkeypar acis_evt2.fits dec_nom;
slsh> dec_nom = pget( "dmkeypar", "value" );
slsh> !dmkeypar acis_evt2.fits roll_nom;
slsh> roll_nom = pget( "dmkeypar", "value" );
slsh> asp = [ atof(ra_nom), atof(dec_nom), atof(roll_nom) ];
slsh> crpix = [ 4096.5, 4096.5 ];
slsh> crdelt = [ -0.492, 0.492 ] / 3600;
slsh> detpos = pix_dmTanWorldToPix( wcspos, asp, crpix, crdelt );

In this example we have used the pix_dmTanWorldToWorld() routine to convert the celestial position of the first event in "evt" into the detector position it would have using the nominal pointing position.

We used the dmkeypar tool to get the RA_NOM, DEC_NOM, and ROLL_NOM keywords from the header of the input file. Since dmkeypar stores the keyword in its parameter file as the "value" parameter, we use the pget() function - from the paramio module - to read these values into S-Lang variables.


See the bugs page for the pixlib library on the CIAO website for an up-to-date listing of known bugs.

See Also

pix_apply_aspect, pix_deapply_aspect, pix_dmtanpixtoworld, pix_dmtanworldtopix

Last modified: December 2009