Remove pincushion/barrel distortion palUnpcd
The distortion is of the form RP = R(1CR2), where R is the radial distance from the tangent point, C is the DISCO argument, and RP is the radial distance in the presence of the distortion.
For pincushion distortion, C is ve; for barrel distortion, C is -ve.
For X,Y in "
radians"
- units of one projection radius, which in the case of a photograph is the focal
length of the camera - the following DISCO values apply:
Geometry DISCO
astrograph 0.0 Schmidt -0.3333 AAT PF doublet 147.069 AAT PF triplet 178.585 AAT f/8 21.20 JKT f/8 13.32
The present routine is a rigorous inverse of the companion routine palPcd. The expression for RP in Note 1 is rewritten in the form x3axb=0 and solved by standard techniques.
Cases where the cubic has multiple real roots can sometimes occur, corresponding to extreme instances of barrel distortion where up to three different undistorted [X,Y]s all produce the same distorted [X,Y]. However, only one solution is returned, the one that produces the smallest change in [X,Y].