This task allows a user to perform coordinate transformations with the full WCS and distortion model on source positions from an input image to sky coordinates. This task serves as a replacement for the IRAF.STSDAS task ‘xy2rd’, albeit with the added capability of understanding the full distortion model provided in the headers of images updated for use with astrodrizzle and tweakreg.
pixtosky - A module to perform coordinate transformation from pixel to sky 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 pixtosky
>>> r,d = pixtosky.xy2rd("input_flt.fits[sci,1]",100,100)
position on the sky for the image ‘input_flt.fits[sci,1]’ using:
>>> from drizzlepac import pixtosky
>>> r,d = pixtosky.xy2rd("input_file_flt.fits[sci,1]", 256,256)
the 3rd and 4th columns from the ASCII file ‘xy_sci1.dat’ will be transformed and written out to ‘radec_sci1.dat’ using:
>>> from drizzlepac import pixtosky
>>> r,d = pixtosky.xy2rd("input_flt.fits[sci,1]", coords='xy_sci1.dat',
colnames=['c3','c4'], output="radec_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.