Table Of Contents

Previous topic

UPDATEWCS - User Interface

Next topic


This Page

WCS Corrections

Time Dependent Distortion

class stwcs.updatewcs.corrections.TDDCorr

Apply time dependent distortion correction to distortion coefficients and basic WCS keywords. This correction must be done before any other WCS correction.

Parameters :

ext_wcs: HSTWCS object :

An HSTWCS object to be modified

ref_wcs: HSTWCS object :

A reference HSTWCS object


Compute the ACS/WFC time dependent distortion terms as described in [R1] and apply the correction to the WCS of the observation.

The model coefficients are stored in the primary header of the IDCTAB. D_{ref} is the reference date. The computed corrections are saved in the science extension header as TDDALPHA and TDDBETA keywords.

TDDALPHA = A_{0} + {A_{1}*(obsdate - D_{ref})}

TDDBETA =  B_{0} + B_{1}*(obsdate - D_{ref})

The time dependent distortion affects the IDCTAB coefficients, and the relative location of the two chips. Because the linear order IDCTAB coefficients ar eused in the computatuion of the NPOL extensions, the TDD correction affects all components of the distortion model.

Application of TDD to the IDCTAB polynomial coefficients: The TDD model is computed in Jay’s frame, while the IDCTAB coefficients are in the HST V2/V3 frame. The coefficients are transformed to Jay’s frame, TDD is applied and they are transformed back to the V2/V3 frame. This correction is performed in this class.

Application of TDD to the relative location of the two chips is done in makewcs.


[R1](1, 2) Jay Anderson, “Variation of the Distortion Solution of the WFC”, ACS ISR 2007-08.

Velocity Aberration Correction

class stwcs.updatewcs.corrections.VACorr

Apply velocity aberation correction to WCS keywords.


Velocity Aberration is stored in the extension header keyword ‘VAFACTOR’. The correction is applied to the CD matrix and CRVALs.

Simple Imaging Polynomial Coefficients

class stwcs.updatewcs.corrections.CompSIP

Compute Simple Imaging Polynomial (SIP) coefficients as defined in [R4] from IDC table coefficients.

This class transforms the TDD corrected IDCTAB coefficients into SIP format. It also applies a binning factor to the coefficients if the observation was binned.


[R4](1, 2) David Shupe, et al, “The SIP Convention of representing Distortion in FITS Image headers”, Astronomical Data Analysis Software And Systems, ASP Conference Series, Vol. 347, 2005

Non-Polynomial Distortion Correction

class stwcs.updatewcs.npol.NPOLCorr

Defines a Lookup table prior distortion correction as per WCS paper IV. It uses a reference file defined by the NPOLFILE (suffix ‘NPL’) keyword in the primary header.


  • Using extensions in the reference file create a WCSDVARR extensions and add them to the science file.
  • Add record-valued keywords to the science extension header to describe the lookup tables.
  • Add a keyword ‘NPOLEXT’ to the science extension header to store the name of the reference file used to create the WCSDVARR extensions.

If WCSDVARR extensions exist and NPOLFILE is different from NPOLEXT, a subsequent update will overwrite the existing extensions. If WCSDVARR extensions were not found in the science file, they will be added.

It is assumed that the NPL reference files were created to work with IDC tables but will be applied with SIP coefficients. A transformation is applied to correct for the fact that the lookup tables will be applied before the first order coefficients which are in the CD matrix when the SIP convention is used.

Detector to Image Correction

class stwcs.updatewcs.det2im.DET2IMCorr

Stores a small correction to the detector coordinates as a d2imarr extension in the science file.


For the case of ACS/WFC every 68th column is wider than the rest. To compensate for this a small correction needs to be applied to the detector coordinates. We call this a detector to image transformation. The so obtained image coordinates are the input to all other distortion corrections. The correction is originally stored in an external reference file pointed to by ‘D2IMFILE’ keyword in the primary header. This class attaches the correction array as an extension to the science file with extname = d2imarr.

Other keywords used in this correction are:

AXISCORR: integer (1 or 2) - axis to which the detector to image
correction is applied
D2IMEXT: string = name of reference file which was used to create
the lookup table extension

D2IMERR: float, optional - maximum value of the correction