% @(#)definefero.hlq	19.1 (ESO-IPG) 02/25/03 14:20:55
% @(#)defineferos.hlq  1.0 (ESO-IPG) 12-11-1997
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1997 European Southern Observatory
%.IDENT      definefero.hlq
%.AUTHOR     AM, LSW Heidelberg, IPG/ESO
%.KEYWORDS   MIDAS, help files, DEFINE/FEROS 
%.PURPOSE    On-line help file for the command: DEFINE/FEROS
%.VERSION    1.0  12-NOV-97 : Creation, AM
%----------------------------------------------------------------
\se
SECTION./FEROS
\es\co
DEFINE/FEROS                                          23-FEB-99 AM/OS
\oc\su
DEFINE/FEROS  [inimage] [intable] [outtable] [locvalues] [threshold] [locparms]
            Search orders in echelle spectrum
\us\pu
Purpose:    
            Search orders in echelle spectrum, fit polynomials to the orders
            and write the coefficients to table descriptors.
\up\sy
Syntax:     
            DEFINE/FEROS [inimage] [intable] [outtable] [locvalues] [threshold]
              [locparams]

\ys\pa
            inimage = input image with echelle spectrum

\ap\pa
            intable = input table with guess values for the order positions
                      in the middle row of the CCD. This is only used, if
                      locmode is set to G

\ap\pa
            outtable = output table with order positions and fit polynomial
                       coefficients

\ap\pa
            locvalues =  cutstep,window,fitdeg
            values for order definition
                cutstep = step size along the order for taking cuts in the
                          cross order direction
                window =  size of the window in which the order center is
                          determined
                fitdeg = degree of the polynomial that is fitted to the orders 
          
\ap\pa
            threshold = threshold value
            background level in ADU. This is only used, if locmode is set to S

\ap\pa
            locparams = locmode locmethod
            Localization parameters
                locmode = localization mode
                valid values are
                S for search lines and
                G for guess table (default)

                locmethod = localization method
                valid values are
                R for center of gravity (default) and
                A for gaussian

\ap\no
Note:      
            1) A guesstable with approximate values for the order positions in
            the middle row of the CCD must be provided if locmode ist set to G.
            The G locmode is intended for two fiber spectra. For single fiber
            spectra it can be used as well.

            2) locparams: The two values must be entered without separators.

\on\exs
Examples:
\ex
            DEFINE/FEROS  flatfield guesspositions foundpositions ? ? GR
            Search for orders in the image named flatfield using a guesstable
            named guesspositions, determine the positions with the center of
            gravity method and write the found order positions, fitted
            order positions and fit polynomial coefficients to a table named
            foundpositions using default values for locvalues and threshold.

\xe\ex
            DEFINE/FEROS flatfield ? foundpositions ?,17,5 0 SA
            Search for orders in the image named flatfield without the use
            of a guesstable. Determine the  positions with the gaussian
            method. Use default value for cutstep, set the width of the
            window in cross order direction to 17 pixels and the polynomial
            degree to 5. Use default values for all other parameters.
\xe \sxe
