Implement the SIP convention for distorting a standard projection.
The SIP distortion as defined in the FITS headers takes place after the
CD matrix has been applied to the data which makes it happen later than
the other distorters. The applyBeforeScaling method is defined to return false
for this scaler. Note that although the CD matrix is applied, the
CRPIX offset is not. In principle it would be possible to adjust
the coefficients so that the distortion took place before the scaling
but we have chosen to mimic the approach used in the SIP definition.
Create a distorter from a FITS header.
We will look for A_ORDER, B_ORDER, A_n_m and B_n_m
keywords. If AP_ORDER and BP_ORDER are found
and the SIPNumericInversion setting is not found, then
we will also look for AP_n_m and BP_n_m for
the inverse distortion.
public SIP(double distortx,
Explicitly set the coefficients for the distorter.
We infer the order from the input arrays. If the
undistort's arguments are given we assume that
the user wishes to use the inverse distortion. If null
then we use numerical inversion of the distortion.
Calculate the distorted (actual pixel) coordinates given the standard coordinates.
Note that the coefficients only give the distortion, so we need to
add in the inputs. Note that primary transformations defined in SIP
go the other way. Given an actual pixel location, they give
the a sky position in the undistorted plane.