match_gwcs_to_sip

grizli.jwst_utils.match_gwcs_to_sip(input, step=64, transform=None, verbose=True, overwrite=True)[source]

Calculate transformation of gwcs to match SIP header, which may have been realigned (shift, rotation, scale)

Parameters
inputstr, HDUList

FITS filename of a JWST image or a previously-opened HDUList with SIP wcs information stored in the first extension.

stepint

Step size of the pixel grid for calculating the tranformation

transformskimage.transform

Transform object, e.g., skimage.transform.SimilarityTransform or skimage.transform.Euclideanransform

verbosebool

Verbose messages

overwritebool

If True and input is a string, re-write to file

Returns
objjwst.datamodels.image.ImageModel

Datamodel with updated WCS object. The REF keywords are updated in img[1].header.

Notes

The scale factor of transformation is applied by multiplying the scale to the last parameters of the distortion WCS pipeline. These might not necessarily be scale coefficients for all instrument WCS pipelines