This task allows a user to perform coordinate transformations with the full WCS and distortion model on source positions from sky coordinates to the WCS defined by an image. This task serves as a replacement for the IRAF.STSDAS task ‘rd2xy’, albeit with the added capability of understanding the full distortion model provided in the headers of images updated for use with astrodrizzle and tweakreg.
skytopix - A module to perform coordinate transformation from sky to pixel coordinates.
This module performs a full distortion-corrected coordinate transformation based on all WCS keywords and any recognized distortion keywords from the input image header.
It can be called from within Python using the syntax:
>>> from drizzlepac import skytopix
>>> x,y = skytopix.rd2xy("input_flt.fits[sci,1]","00:22:36.79","-72:4:9.0")
position on the image ‘input_flt.fits[sci,1]’ using:
>>> from drizzlepac import skytopix
>>> x,y = skytopix.rd2xy("input_file_flt.fits[sci,1]", "00:22:36.79","-72:4:9.0")
the 3rd and 4th columns from the ASCII file ‘radec_sci1.dat’ will be transformed and written out to ‘xy_sci1.dat’ using:
>>> from drizzlepac import skytopix
>>> x,y = skytopix.rd2xy("input_flt.fits[sci,1]", coordfile='radec_sci1.dat',
colnames=['c3','c4'], output="xy_sci1.dat")
Primary interface to perform coordinate transformations from pixel to sky coordinates using STWCS and full distortion models read from the input image header.