As explained in the section on position lists, when a position list is associated with an image which has suitable coordinate systems attached to it, explicit transformation of positions in the list is usually not necessary, since the CCDPACK programs which use the lists will transform them into the Current coordinate system automatically.
When dealing with the old TRANSFORM-based methods however this can be required, and it may occasionally be wanted when using the new coordinate system methods, for instance for examination of image coordinates by a human or a program other than a CCDPACK one, or if position lists are still needed for some reason after the image is resampled. In these cases, the coordinates of each point in a position list can be transformed using the routine:
Transforming positions using transform structures is usually straight-forward, provided you've registered your data and entered this information into the images using REGISTER, or have added coordinate systems or TRANSFORM structures in some other way.
Transforming positions selected from one dataset (say using the IDICURS application) to a reference coordinate system (or vice-versa), is fairly straight-forward given registered datasets. It is also possible to transform to the coordinates of another dataset. The sequence of commands for this operation goes like:
% display img  % idicurs in=img outlist=img.approx  % findcent inlist=img outlist=img.acc  % tranlist trtype=wcs inlist=img framein=pixel  frameout=ccd_reg % tranlist trtype=wcs inlist=img inext=false  outlist=img.look wcsfile=newimg framein=pixel frameout=ccd_reg
Using linear coefficients is a quick way of applying offsets, scales and rotations to data. The linear transform form is:
The TR(1-6) correspond to the coefficients you give to TRANLIST. The identity transformation is [0,1,0,0,0,1] which corresponds to the coefficients [TR(1),TR(2),TR(3),TR(4),TR(5),TR(6)]. So an offset in X and Y would be [TR(1),1,0,TR(4),0,1]. Scaling uses the TR(2,3,5, & 6) coefficients. Rotation uses the coefficients:XX = TR(1) + TR(2) * X + TR(3) * Y YY = TR(4) + TR(5) * X + TR(6) * Y
where is the angle to rotate (counter-clockwise). So a rotation of 45 degrees counter-clockwise about (0,0) is [0,0.7071,-0.7071,0,0.7071,0.7071].
General transformations are expressed in a `Fortran-like' form and may use the functions SIN, TAN, COS, ASIN, ACOS, LOG, LOG10 and many others which are listed in SUN/61 appendix A. An example of using this capability is to transform positions by a parameterised pin-cushion distortion:
This also shows how to use sub-expressions to reduce complex formulae to more manageable levels (x and y are offset and scaled to some arbitrary level and now masquerade as fx and fy). This also allows quick modifications since only the values of the parameters need to be changed on re-runs. Note that a coordinate system representing a pincushion distortion could be added instead to an image using WCSEDIT (described elsewhere).% tranlist xfor = ( fx * ( 1 + pa * ( fx*fx + fy*fy ) ) ) * ps + px yfor = ( fy * ( 1 + pa * ( fx*fx + fy*fy ) ) ) * ps + py fx = ( x - px ) / ps fy = ( y - py ) / ps pa = 21.4 px = 100.0 py = 200.0 ps=11.5