WFPC2_METRIC
Name
WFPC2_METRIC
Purpose
Compute the distortion in a WFPC2 image and optionally return coordinates
EPLANATION:
Uses the distortion solution of Anderson & King (2003, PASP, 115, 113)
Pixel 424, 424 on each chip remains fixed, and other pixel positions are
mapped to remove nonlinearities. If /GLOBAL is set, then all chips are
put on the same reference frame where pixel 424, 424 in the WF3 chip
remains fixed.
Calling Sequence
WFPC2_METRIC, xin, yin, xout, yout, [ChipNum, HEADER=, /GLOBAL
YEAR =, FILTER=
or
WFPC2_METRIC, xin, yin, a, d, HEADER=, /RAdec, /GLOBAL ]
Inputs
XIN, YIN - X,Y positions (0-799) on a WFPC2 chip in
IDL convention (first pixel is 0,0), scalar or vectors
Outputs
XOUT, YOUT - X,Y positions in the undistorted frame, same number of
elements as XIN, YIN
or if /RADEC is set
AA, DD - Right ascension and declination (in degrees) corresponding
to the input coordinates after distortion correction.
Optional Input
ChipNum - Integer 1, 2, 3, or 4 specifying the WFPC2 chip number
1-PC, 2-WF2, 3-WF3, 4-WF4. If not supplied, then WFPC2_METRIC
will try to read the value from the DETECTOR in the FITS header.
Optional Inputs
/GLOBAL - If set, then positions are returned in a master reference
frame with pixel 424,424 of WF3 remaining fixed. Thus,
information concerning the interchip separation and
orientation (with a weak dependence on time and filter) is
incorporated.
Header - FITS header with astrometry for a particular chip.
If both /RADec and /Global are set, then the header must be
from the WF3 chip.
/RADec - If set, then astrometry information in the FITS header (which
must be supplied as a keyword) is used to convert the output
to Right Ascension and declination (both in degrees).
FILTER - Filter name needed if /GLOBAL is set, must be either 'F300W'
'F336W', 'F439W', 'F555W' or 'F814W'; otherwise the plate scale
for F555W is assumed. WFPC2_METRIC will try to read this
value from the FITS header if not supplied as a keyword.
YEAR - Observation year including fraction (e.g. 1998.56) needed if
/GLOBAL is set. WFPC2_METRIC will try to read this value from
the FITS header if not supplied as a keyword. The time
correction is currently applied through the year 2002; later
dates will use the year 2002 correction.
Examples
(1) Find the undistorted X,Y coordinates of position 682.3,234.2 on chip 1
(the PC chip).
IDL> WFPC2_METRIC, 682.3, 234.2, xout, yout, 1
==> xout = 681.13 yout = 235.05
(2) Determine the RA and Dec of position 682.3, 234.2 on chip 1 on the
WFPC2 image U2Z30201T
IDL> WFPC2_READ, 'u2z30201t.c0h', im,h ;Get header for chip 1
IDL> WFPC2_METRIC, 682.3, 234.2, aa, dd, header= h,/RADec
IDL> print, adstring(aa,dd,2)
05 20 53.572 -69 35 18.17
Note that a chip number did not need to be specified since its value
is in the FITS header
(3) As above, but now compute coordinates in the global frame, needed
for example, to compute the distance between stars on two different
chips.
First get headers for chips 1 and 3
IDL> WFPC2_READ, 'u2z30201t.c0h', im1,h1, im3,h3,num=[1,3]
IDL> WFPC2_METRIC, 682.3, 234.2, aa, dd, 1, header=h3,/RADec,/GLOBAL
IDL> print, adstring(aa,dd,2)
05 20 53.513 -69 35 17.98
Note that with /GLOBAL set, that the header must be for WF3, even
though coordinates are being computed for chip 1. Also note that
the time and filter will be read from the FITS header. Finally,
note that the coordinates given in examples (2) and (3) differ
slightly, because the chip separations incorporated in the FITS
headers differ slightly from those in the Anderson & King solution.
Procedures Used
LINTERP, SXPAR(), XYAD, YMD2DN()
Revision History
Written W. Landsman March 2003