idlastro / FITS Astrometry and Calibration: TNX_EVAL

[Source code]

NAME
TNX_EVAL
PURPOSE
Compute distorted coordinates given TNX (Tangent + Iraf tnx
distortion  polynomial) coefficients.
EXPLANATION
See http://fits.gsfc.nasa.gov/registry/tnx.html for the TNX convention
This distortion convention is used by IRAF.    The current procedures only
supports simple polynomials and not Legendre or Chebyshev polynomials
The coefficients and information are passed via common block.    This is because this
routine is called by the intrinisc BROYDEN() function in AD2XY, and 
common blocks are the only way to pass parameters to the user supplied 
function in BROYDEN().  
CALLING SEQUENCE
res = TNX_EVAL(xy)   
INPUTS
xy - 2 elements vector giving the undistorted X,Y position  
OUTPUTS
res - 2 element vector giving the distorted position 
COMMON BLOCKS
common broyden_coeff,pv1,pv2
pv1, pv2 are both structures giving the TNX coefficients. The
pv1/pv2 naming convention is a hangover from tpv_eval.pro on
which this approach is heavily based.
pv1.functype gives the TNX function type. Only type 3
   (polynomial) is supported.
pv1.xterms gives the type of cross-terms (1: full, 2: half, 0: none)
pv1.etaorder gives the order in eta
pv1.xiorder gives the order in xi
pv1.coeff gives the actual coefficients.
REVISION HISTORY
Written   M. Sullivan                  Mar 2014
Use post-V6.0 notation  W. Landsman    Feb 2015