Output Image Generation

This module manages the creation of the output image FITS file.

 Warren Hack
class drizzlepac.outputimage.OutputImage(plist, input_pars, build=True, wcs=None, single=False, blot=False)

This class manages the creation of the array objects which will be used by Drizzle. The three arrays, SCI/WHT/CTX, will be setup either as extensions in a single multi-extension FITS file, or as separate FITS files.

The object ‘plist’ must contain at least the following members:

plist['output']   - name of output FITS image (for SCI)
plist['outnx']    - size of X axis for output array
plist['outny']    - size of Y axis for output array

If ‘single=yes’, then ‘plist’ also needs to contain:


If ‘blot=yes’, then ‘plist’ also needs:


If ‘build’ is set to ‘no’, then each extension/array must be in separate FITS objects. This would also require:

plist['outdata']    - name of output SCI FITS image
plist['outweight']  - name of output WHT FITS image
plist['outcontext'] - name of output CTX FITS image

Optionally, the overall exposure time information can be passed as:

plist['texptime'] - total exptime for output
plist['expstart'] - start time of combined exposure
plist['expend']   - end time of combined exposure
addDrizKeywords(hdr, versions)

Add drizzle parameter keywords to header.

find_kwupdate_location(hdr, keyword)

Find the last keyword in the output header that comes before the new keyword in the original, full input headers. This will rely on the original ordering of keywords from the original input files in order to place the updated keyword in the correct location in case the keyword was removed from the output header prior to calling this method.


Method used to update the value of the bunit attribute.


Method used to record what units were specified by the user for the output product.

writeFITS(template, sciarr, whtarr, ctxarr=None, versions=None, overwrite=True, blend=True, virtual=False)

Generate PyFITS objects for each output extension using the file given by ‘template’ for populating headers.

The arrays will have the size specified by ‘shape’.