9.2.1Coordinate Transformations

There are three coordinate systems applicable to WFC3 Images. First, there is the position of a pixel on the geometrically distorted flat-fielded images (flt) after pipeline processing through calwf3. Second, there is the pixel position on the drizzled images (drz) created by AstroDrizzle, which corresponds to an undistorted pixel position on a tangent plane projection of the sky. Third, there is the corresponding world coordinate (RA, Dec) position on the sky.

Utilities to transform between these coordinate systems are built on the WCSLIB, a C library that implements the FITS standards for World Coordinate System (WCS) information. For transformations involving (flt) images, the distortion information in the FITS header is used to correct for the very large effects of geometric distortion. Drizzlepac and astropy WCS are two commonly-used Python interfaces to this library that implement these transformations.

For example, consider an object found at x,y pixel position (152,156) on UVIS chip 1 on an image (test_flt.fits). The position on the celestial sphere and the corresponding pixel position on a distortion-corrected file (test_drz.fits) can be found as follows.

Example #1 Transform pixel position from flat fielded frame (flt) to sky frame using astropy wcs.all_pix2world

 `>>> from astropy.io import fits``>>> from astropy.wcs import wcs``>>> import numpy as np`

Create wcs object containing WCS keywords from header.

 `>>> flt_wcs = wcs.WCS(fits.getheader('test_flt.fits', 1), fits.open('test_flt.fits'))`

Find RA and Dec corresponding to pixel position (152,156) on the image (flt).

 `>>> pixcrd_flt = np.array([[152,156]])``>>> flt_skycoords = flt_wcs.all_pix2world(pixcrd_flt,1)`

The task `astropy.wcs.all_pix2world` does all three transformations in series (table lookup distortions, SIP, and core WCS) from pixel to world coordinates. SIP (Simple Imaging Polynomial) is a convention for storing distortion information in FITS file headers (e.g. Shupe et al., 2005).

Example #2 Transform pixel position from flat fielded frame (flt) to drizzled frame (drz) using `astropy.wcs`

Continuing from the code in Example 1, also create wcs object from drizzled image (drz):

 `>>> drz_wcs = wcs.WCS(fits.getheader('test_drz.fits', 1))`

Use `all_world2pix` to convert the sky position (found in Ex 1.) into pixel position in the drizzled image (drz).

 `>>> drz_pix = drz_wcs.all_world2pix(flt_skycoords, 1)`

9.2.2Absolute and Relative Astrometry

Beginning in 2020, the World Coordinate System (WCS) in the header of WFC3 images is corrected by a variety of methods to improve absolute astrometry. All the solutions are stored in an astrometry database and placed in extra headerlet extensions of WFC3 images (flt, flc). The first method is the update of guide star positions (RA/Dec) in the newest version of the guide star catalog. Due to the motion of the Fine Guidance Sensors in the focal plane, the absolute uncertainty of these astrometric solutions may still be as large as 200 mas. Next, an automatic alignment is attempted, where sources in the image are detected and matched to the Gaia EDR3 catalog. If successful, the absolute astrometry of the images is substantially improved, reducing astrometric uncertainty to less than 20 mas. If sources are unable to be matched to Gaia EDR3, matching to GSC v2.4.2 followed by 2MASS is tried. However, in the cases where this fails, the realigned guide star solution remains active. Please refer to WFC3 ISR 2022-06 for more details on improved absolute astrometry for WFC3 data products.

While aligning to Gaia may provide better absolute astrometry, the alignment uncertainties may result in individual exposures with slightly poorer relative alignment to each other.  Restoring the original, not-aligned-to-Gaia solution, where the WCS is based on guide star pointing information and image distortion correction table (`IDCTAB`), may improve relative astrometry, at the cost of absolute astrometric precision.  In general, the default `IDCTAB` solution used before aligning to Gaia has very good relative astrometry (typically a few mas), except in the cases of guide star loss or very large dithers.  The various alignment solutions can be activated for individual exposures through the `stsci.wcsutil.headerlet` interface.  Examples of this interface are presented in a Jupyter notebook Using Updated Astrometry Solutions. Users requiring either precise relative or precise absolute astrometry will want to assess the available solutions, database and interface described in detail in section 4.5 of the Drizzlepac Handbook.

In cases where the astrometric solutions included with the data are insufficient for science purposes, WFC3 images can be realigned using the HST software DrizzlePac. Specifically, images can be aligned to each other or to external catalogs using the DrizzlePac task TweakReg.  This is often necessary for comparing images of the same target from different epochs (or visits), or producing mosaicked images with AstroDrizzle. In some cases, the aligned-to-Gaia astrometric solutions may also provide sufficient accuracy to create mosaic images, particularly if there are many Gaia stars covering the extent of the mosaic. Examples of various alignment procedures are presented in the DrizzlePac Notebooks.

9.2.3Impact of Guide Star Failure

The guiding performance and pointing stability of HST are described in the HST Primer. The normal guiding mode uses two guide stars that are tracked by two of HST’s Fine Guidance Sensors (FGSs). However, sometimes two suitable guide stars are not available and single-star guiding is used instead with the telescope roll controlled by the gyros.  Such observations will experience small drifts around the guide star. To determine the quality of tracking during these observations, please review Observation Logs in the Introduction to the HST Data Handbooks. In recent years, as gyroscopes have failed and been replaced, the typical drift rate under single-star guiding has increased from 1.5 mas/sec to ≤17 mas/sec. This drift causes a rotation of the observed field around the single guide star, which in turn introduces a small translational drift of the targets on the detector. The exact size of the drift depends on the exact roll drift rate and distance from the single guide star to the target in the HST field of view. For WFC3, with the current drift rate, the roll about the guide star produces a translation of up to 60 mas (1.5 UVIS pixel, 0.45 IR pixel) in 1000 sec.

The TweakReg  task may be used to measure and correct for any shifts between successive exposures. The drift over an orbital visibility period can be calculated from this number; the typical visibility period in an orbit (outside the Continuous Viewing Zone [CVZ]) is in the range 52-60 minutes, depending on target declination (HST Primer). The drifts inherent to single-star guiding are not represented in the image header astrometric information, with two important consequences:

• There will be a slight drift of the target on the detector within a given exposure. Originally, for the majority of observations and scientific programs, this did not degrade the results, especially for short exposures. Normally the drift was smaller than the FWHM of the point spread function (PSF), comparable to the typical jitter during an HST observation (0.003-0.005 arcsec) even when two guide stars were used. Currently however, the drift on the detector could measurably affect the size and shape of the PSF.
• There will be small shifts between consecutive exposures which can build up between orbits in the same visit. This will affect the automated AstroDrizzle products from the pipeline since the pipeline relies on the header astrometry, e.g. the structure of sources (i.e. PSFs and extended targets) in the image will be degraded during the cosmic ray rejection routine. However, the user can address these issues by first measuring the shifts and then running AstroDrizzle off-line using those shifts.

Note that even when two guide stars are used, there is often a slow drift of the telescope, up to 0.01" per orbit, due to thermal effects. So, it is generally advisable to check the image shifts, and if necessary measure them to improve the alignment of exposures before running AstroDrizzle off-line to perform the cosmic ray rejection and image combination.

In summary, for most scientific programs, single-star guiding will not necessarily degrade the usefulness of WFC3 data, provided the shifts are measured post-facto and AstroDrizzle is re-run offline using those shifts. However, we do not recommend single-star guiding for programs requiring very accurate knowledge of the PSF (e.g. astrometric programs) or for programs that rely critically on achieving a dithering pattern that is accurate on the sub-pixel scale (which often are not achievable even with two-star guiding).