% @(#)rectifirsp.hlq	19.1 (ESO-IPG) 02/25/03 14:23:16 
% @(#)
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1992 European Southern Observatory
%.IDENT      rectifirsp.hlq
%.AUTHOR     E.Oliva, Arcetri (Florence)
%.KEYWORDS   MIDAS, help files, RECTIFY/IRSPEC
%.PURPOSE    On-line help file for the command: RECTIFY/IRSPEC
%.VERSION    1.0  22-SEP-1992 : Creation, E.Oliva
%----------------------------------------------------------------
\se
SECTION./IRSPEC
\es\co
RECTIFY/IRSPEC                                        22-SEP-1992 EO
\oc\su
RECTIFY/IRSPEC in out [l=load_opt.] [tilt=tilt_value] [ref=reference_row]
        Rectify tilted spectral lines.
\us\pu
Purpose:    The slit images at the various wavelengths ("spectral lines")
            are tilted as a consequence of the off-axis mount of the
            grating, and the angle by which they are tilted varies with
            the position of the grating, i.e. with the wavelength.
            This command is intended to correct for this effect and
            hence "rectify" the spectral lines.
            The tilt angle is computed analytically from the instrumental
            calibration parameters (on line central wavelength etc.) which
            are stored as descriptors in the original frames.
            The user can also choose the value manually.
\up\sy
Syntax:     RECTIFY/IRSPEC in out [load=load_opt.] [tilt=tilt_value] 
                           [ref=reference_row]
\ys\pa
            in      = input frame. Must have the original size with starts 
                      and steps all equal to 1. Untouched on exit.
\ap\pa
            out     = name of the output, rectified image. \\
\\
            Additional parameters and options:
\ap\pa 
            load    = 0,1 default=0.
                      If =0 (the default) the command works silently.
                      If =1 it will display the image before and after 
                      tilting.
\ap\pa
            tilt    = real number, default=0
                      If =0 (default) the command computes automatically
                      the tilt angle. Use any other value to force the
                      program to apply a given tilt angle.
\ap\pa
            reference_row = integer number, default=0.
                      Position of the "pivotal" (or "fulcrum") row which 
                      is left untouched by the tilt procedure.
                      If =0 (the recommended default) it takes the middle 
                      row of the frame. \\
                      You can also use any positive number (not larger 
                      than the Y-size of the array) but, if you do, you may
                      get into troubles with the wavelength calibration
                      (see also TUTORIAL/CALIBRATE).                 
\ap\no
Note:       If you use the automatic (default) choice of the tilt angle and
            get strange error messages it may be that your input frame (e.g.
            the result of a long series of operations) has lost the descriptors
            which are needed by the program. Try then\\
               COPY/DD orig *,3 frame\\
            where "frame" is your image and "orig" is (one of) the original
            frames taken at the same grating position.
\\
            The X-sizes of the input and output frame are the same. This
            means that, after applying RECTIFY/IRSPEC, you lose information 
            about 2 opposite corners of your image and "invent" data in the 
            other two edges.
\\
            To be precise, the spectral lines are section of non-parallel
            parabolae. However, one can verify that approximating them
            as parallel lines introduces errors well below 1 pixel over
            the entire array. The analytical value of the tilt angle should
            also be accurate within a fraction of a pixel
\on\exs
Examples:
\ex
            RECT/IRS a0012 obj1 
\xe\ex
            RECT/IRS a0012 obj2 t=-0.12 l=1
              (note that tilt=.. etc. can be abbreviated with t=... etc.)
\xe\ex
            RECT/IRS a0012 obj3 r=33 l=1
\xe\sxe








