DrizzlePac Features

Support for Automated Mosaic Building

TweakReg now provides support for aligning images that do not directly overlap with the reference image and/or catalog (eg. building mosaics). In the default configuration when the user does not supply their own reference catalog and/or image, this is done by choosing a pair of images (from the input list of images) with the largest overlap in the sky and trying to align them. One image will be used to produce the "reference catalog" while the other image will be aligned to this catalog. Now, the sources from the second image that have not been matched to the reference catalog are considered as "good new sources" and will be added to the reference catalog. This way, the reference catalog keeps expanding with each new matched image. With a large (expanded) reference catalog now it is possible to align images that did not have a direct overlap with the starting image. This feature can be turned off using the "expand_refcat" parameter only when the user provides his/her own reference catalog that is of high confidence and the user does not desire TweakReg adding new sources to this high quality catalog.

Mitigation of False Detections

TweakReg’s source finding task (imagefind) now includes additional parameters to exclude false detections and allow the software to more easily solve for the image offsets using matched sources lists. For example, ‘dqbits’ is a list of DQ flag values to include as ‘good’ or to exclude as ‘bad' before generating and matching source lists. For WFC3/UVIS, setting dqbits=-16 will mask hot pixels flagged by the instrument team, eliminating a common problem where TweakReg locks onto hot pixels and solves for the dither pattern. This can occur when users set the detection threshold value too low and hot pixels outnumber astronomical sources. Other new parameters allow selection for sharpness and roundness, which give users better control over source selection criteria and the mitigation of artifacts.

Align Different HST Cameras

The new TweakReg software makes it easier for users to align different HST detectors by allowing for separate sets parameters (threshold, conv_width, etc) between the input list and the reference image. For example, the command used to align WFC3/UVIS and WFC3/IR images would be:

>>>  tweakreg.TweakReg(‘@wfc3_uvis_flt.list',\
                     imagefindcfg={'threshold':10,'conv_width':3.5},\
                     refimage=‘wfc3_ir_f160w_drz_sci.fits',\
                     refimagefindcfg={'threshold':200,'conv_width':2.5}) 

Aligning to Non-HST Image

Alignment of HST data to non-HST images refers to the process of modifying the WCS information in the header of the HST image so that sources in the HST images match the positions of the same sources in the non-HST image. This will correct the astrometry of the HST data to match that of the non-HST image, presumably to allow comparisons of the HST data with other published results. The alignment to a non-HST image can only be performed when all distortions have been corrected in the WCS of the non-HST image. Spitzer images, for example, typically include SIP distortion coefficients as part of their WCS. On the other hand, SWIFT and DSS images do not contain any description of distortion in the WCS keywords.

One requirement for getting non-HST images to work with the DrizzlePac code remains an adherence to the FITS standards for multi-extension files and for describing the WCS. The DrizzlePac code relies on wcslib through the astropy.wcs  (previously, the pywcs) library to read in the WCS keywords. In addition, HST multi-extension FITS files specify the extensions using EXTNAME and EXTVER keywords to designate the SCI, ERR and DQ extensions, and the code expects all inputs to conform to the same conventions. This may require updating the headers of the non-HST images to include these keywords to match the format of HST images. 
This was done easily for SWIFT data using the following commands:

>>>  from astropy.io import fits as pyfits 
>>>  cp sw00031905002uuu_sk.img sw00031905002uuu_sk.fits 
>>>  swift = pyfits.open('sw00031905002uuu_sk.fits', mode='update') 
>>>  swift[1].header['EXTNAME'] = 'SCI'< 
>>>  swift[1].header['EXTVER'] = 1< 
>>>  wift.close() 

The file in this example (sw00031905002uuu_sk.fits) can now be used as a reference to align non-HST images with no additional changes. For example, the command to align a set of FLT files to the SWIFT file would be:

>>> tweakreg.TweakReg(‘*flt.fits', \
                     imagefindcfg={'threshold':10,'conv_width':3.5},\
                     refimage='sw00031905002uuu_sk.fits',\
                     refimagefindcfg={'threshold':200,'conv_width':2.5},\
                     minobj=5,\
                     searchrad=5.0,\
                     updatehdr=True,\
                     wcsname=’SWIFT',\ 
                     interactive=True)

and if you already have a reference catalogue (with the name 'swift.cat'), you would use the following command:

 >>> tweakreg.TweakReg(‘*flt.fits',\
                     imagefindcfg={'threshold':10,'conv_width':3.5},\
                     refimage='sw00031905002uuu_sk.fits',\
                     refcat=’swift.cat',\
                     minobj=5,\
                     searchrad=5.0,\
                     updatehdr=True,\
                     wcsname=’SWIFT',\
                     interactive=True)

This specific SWIFT image corresponds to an image of M83 that overlaps with images taken by HST/WFC3 in Proposal 11360 using the F814W filter, the same images described in DrizzlePac Handbook Chapter 7.5 "WFC3/UVIS: Aligning Images by Defining an Output Frame". The HST images can be drizzled together to form a cosmic-ray cleaned, distortion free image, then aligned to the SWIFT image. The updated drizzled HST image can then be used to correct the WCS in the calibrated HST images that went into creating the drizzled image using tweakback and all HST images would then be aligned to the SWIFT image. The sources found in the SWIFT image and the drizzled HST image can be seen in the included figures, with the alignment being limited by the large pixel size for the SWIFT image.

These images do not demonstrate the most accurate use of this technique, rather that the DrizzlePac code can be used to align HST images to non-HST data. Furthermore, although it would seriously degrade the HST data, the SWIFT image could also be used to define the output results from drizzling the HST images if desired using astrodrizzle. The SWIFT image would simply need to be provided as the 'final_refimage' parameter in astrodrizzle to create an HST product that matches the alignment and pixel scale of the SWIFT image. The animated GIF below shows an HST image drizzled using the SWIFT image as reference.

Drizzled to swift

Please note that due to the fact that non-HST images do not provide full distortion solutions in the WCS and that the code was developed to support HST images only, non-HST images can NOT be aligned to HST images or drizzled with astrodrizzle without heavy manual modifications to the headers of the non-HST images. Such changes are beyond the scope of normal usage and will only be supported as resources permit by contacting the HST Help Desk.

W.Hack and M. Cara