% @(#)astromtran.hlq	19.1 (ESO-SDAG) 02/25/03 13:23:00
\se
SECTION./ASTROM
\es\co
ASTROMETRY/TRANSFO		  		           17-Oct-1994 OH, RHW
\oc\su
ASTROMETRY/TRANS std mes center pla,cat schmidt,blink tol xterm,yterm std
	Compute the astrometric transformation parameters of a data
\us\pu
Purpose:
	Compute the astrometric transformation parameters of a data
        set. 
\up\sy
Syntax:   
	ASTRO/TRANS std mes center pla,cat schmidt,blink tol xterm,yterm std 
\ys\pa
        std = table containing the standars stars coordinates. It must contain
              the following columns:\\
                :PPM  Identifier (<=6digit intg) (must be called :PPM
                      even if the standards are not from that catalogue);\\
                :R_A  Right Ascension in deg;\\
                :DEC  Decl. in deg;\\
                :MAG  Magnitude;\\
                :PMA  Proper Motion in RA in arcsec/year (NOT time_second);\\
                :PMD  Proper Motion in Dec in arcsec/year;\\ 
\\
                A convenient way to produce this table is to use
                StarCat, with the MIDAS table output option, in the
                PPM catalogue;\\
\ap\pa
        mes =   table containing the XY measurements; It must contain
                the following columns:
                :IDENT Identifier; must contain a number, leading letters 
                       (eg, PPM) are ignored 
                :Xcen  X measurement
                :YCEN  Y Measurement
\ap\pa
        center = coordinates of the center, either
                Ah,Am,As,Ddeg,D',D" = the actual coordinates of the
                       center (the decli. between -1 and 0 are handled
                       properly), or
                MEAN   to take the barycenter of the measured
                       standards (useful for CCD astrometry; don't use
                       on plates).
\ap\pa
        pla,cat = epoch of the plate (date at which it was taken)
                and reference epoch of the catalogue (in decimal
                year); note that cat is NOT necessarilly the equinox
                of the catalogue coordinates. For the PPM, pla=2000.
\ap\pa
        schmidt,blink = instrument flags
                schmidt = Y if a (curved) schmidt plate was measured,
                       N otherwise (plane detector, like a CCD)
                blink = Y if the plate was measured with the La Silla
                       blink (which has a funny unit coding), N
                       otherwise (normal measuring machine dealing
                       correctly with negative units, eg OPTRONICS, or
                       MIDAS CENTER/GAUSS)
\ap\pa
        tol = tolerance on the  measurements RMS (in measurement
                unit, eg micron or pixel); meaningfull only in case of
                multiple measurements like those made on the
                OPTRONICS. The points outside the tolerance range are
                delete.
\ap\pa
        xterm,yterm = terms to be used for the astrometric
                calibration in X and Y. Set the digit to 1 to select
                the term, to 0 to ignore it. The terms are:
                X Y  XY X**2 Y**2 X**3 Y**3 XY**2 YX**2
                For a first try, or a CCD, use 111000000,111000000;
                for a small region of a Schmidt plate, use 111110000,
                and for a full Schmidt plate, 111111111.
                Note that standard stars in sufficient number must be
                measured, at least 2--4 time the number  of terms.
\ap\pa
        std = selection of the standard flag.
                A takes all the standards (eg, first try), U only the
                undeleted ones (subsequent try). Use residual.prg to
                select/unselect the standards.
\ap\sa
See also:
    	ASTROMETRY/EDIT, ASTROMETRY/COMPUTE, ASTROMETRY/POS1
\as\no
Note:  
        This program computes the parameters using a least-square
        algorithm. It is a upgraded version of Richard West's standalone
        program. The accuracy MIDAS is excellent; it has been tested on 
        standard stars, and in real life on many objects including comet 
        Shoemaker-Levy 9, leading to very accurate impact times.\\
\\
        ASTROMETRY/TRANSFO computes only the transformation
        parameter; use ASTROMETRY/COMPUTE to perform the actual coordinate
        conversions. Use ASTROMETRY/EDIT  to edit the standard stars
        (delete/reset) and to display a map of the redidual.\\
\\
        ASTROMETRY/POS1 is a small procedure asking for the paramaters
        of ASTROMETRY/TRANSFO, ASTROMETRY/EDIT, ASTROMETRY/EDIT in an
        interactive way, simulating the former stand-alone pos1.
\on\exs
Examples:
\ex
        ASTROMETRY/POS1
        Start an interactive astrometric reduction.\\
\xe\ex
        ASTROMETRY/TRANSFO POS1A ppm3 p300 17,21,2.2,-33,56,40 -
                  1969.83,2000. yn 3 111110000,111110000 A 
        Reduction of a Schmidt plate (not measured with the La Silla
        blink): first iteration (All stars take, only 5 terms). The
        standards are in ppm3.tbl, the xy measurements in p300.tbl.
        The plate was taken on 1969.83, centered on 17,21,2.2 -33,56,40. 
        The epoch of the catalogue is 2000; the tolerance is set to 3 micron.
\xe\ex
        ASTROMETRY/EDIT ppm3 
        Edit the standards 
\xe\ex
        ASTROMETRY/TRANSFO ppm3 p300 17,21,2.2,-33,56,40 1969.83,2000. yn 3
                           111111111,111111111 U
        Second iteration of the reduction: all the terms are set, and
        only the undeleted standards are taken for the transformation.
\xe\ex
        ASTROMETRY/EDIT ppm3 P
        Edit the standards, and display a map of the residuals
\xe\ex
        ASTROMETRY/TRANSFO ppm3 p300 17,21,2.2,-33,56,40 1969.83,2000. - 
                           yn 3 111111111,111111111 U
        Third iteration of the reduction: all the terms are set, and
        only the undeleted standards are taken for the transformation.
\xe\ex
        ASTROMETRY/COMPUTE p300 2
        Computes the RA Dec of the measured objects.
\xe \sxe
