This task allows a user to perform coordinate transformations with the full WCS and distortion model to and from drizzled image positions. This task serves as a replacement for the STSDAS.dither task ‘tran’.
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 pixtopix
>>> outx,outy = pixtopix.tran("input_flt.fits[sci,1]",
"output_drz.fits[sci,1],"forward",100,100)
‘input_flt.fits[sci,1]’ into a position on the output image ‘output_drz.fits[sci,1]’ using:
>>> from drizzlepac import pixtopix
>>> outx,outy = pixtopix.tran("input_file_flt.fits[sci,1]",
"output_drz.fits[sci,1],"forward", 256,256)
the 3rd and 4th columns from the ASCII file ‘xy_sci1.dat’ will be transformed into pixel positions from ‘input_flt.fits[sci,1]’ and written out to ‘xy_flt1.dat’ using:
>>> from drizzlepac import pixtopix
>>> x,y = pixtopix.tran("input_flt.fits[sci,1]", "output_drz.fits[sci,1]",
"backward", coords='xy_sci1.dat', colnames=['c3','c4'],
output="xy_flt1.dat")
Primary interface to perform coordinate transformations in pixel coordinates between 2 images using STWCS and full distortion models read from each image’s header.