% @(#)flat_irsp.hlq	19.1 (ESO-IPG) 02/25/03 14:23:16 
% @(#)
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1992 European Southern Observatory
%.IDENT      flat_irsp.hlq
%.AUTHOR     E.Oliva, Arcetri (Florence)
%.KEYWORDS   MIDAS, help files, FLAT/IRSPEC
%.PURPOSE    On-line help file for the command: FLAT/IRSPEC
%.VERSION    1.0  21-SEP-1992 : Creation, E.Oliva
%----------------------------------------------------------------
\se
SECTION./IRSPEC
\es\co
FLAT/IRSPEC                                      21-SEP-1992 EO
\oc\su
FLAT/IRSPEC in_flat in_dark out [l=load_opt.] [t=threshold] 
            [v=vignetted_value]
        Create a normalized flat from an input flat frame.
\us\pu
Purpose:    To create a normalized flat from an halogen frame.
            It can be stored and made available for use typing 
            SET/IRSPEC flat=....
            See also SKYSUB/IRSPEC, TUTORIAL/SKYSUB and CALIBRATE/IRSPEC 
\up\sy
Syntax:     FLAT/IRSPEC in_flat in_dark out [load=load_opt.] 
                        [thres=threshold] [vignet=vignetted_value]
\ys\pa
            in_flat =  input flat image. Must have the original size with 
                       starts and steps all equal to 1. Untouched on exit.
\ap\pa
            in_dark =  optional name of a dark frame (with same integration
                       time as the flat); set it to -- 0 -- if no dark
                       is needed (see first example). Untouched on exit.
\ap\pa
            out     =  name of the output, normalized flat image. This
                       is automatically corrected by the bad pixels (see
                       BADPIX/IRSPEC).\\
\\
            Additional parameters and options:\\
\ap\pa 
            load    =  0 or 1 default=1.
                       If =1 (default) it will display the images during the 
                       various phases of the process. if =0 the command works 
                       silently.
\ap\pa
            threshold = real positive number, default=0.5.
                       All the rows in the input image with average values
                       lower than threshold*aver_cen ("aver_cen" being the 
                       average value of the central 6 rows) are considered 
                       as vignetted and will be forced to "vignetted_value" 
                       (the next parameter).
\ap\pa
            vignetted_value = \\real number, default=100.
                       Value assigned to all the pixels in vignetted rows 
                       (defined through the previous parameter) in the 
                       output image.
\ap\no                       
Note:       The normalization procedure just consists of dividing the
            original frame, cleaned of the bad pixels, by the average
            value of the central 6 rows (this value is also stored
            in the identifier starting from the 20-th character).
            Hence, the normalized output image contains also the 
            detector response at low spatial frequencies. Use FIT/FLAT 
            or similar commands if you need a "more normalized" flat.
            The vignetted rows are set to large values in order to make
            them vanishing after division by the flat.
\\
            For applications up to 2.5 microns the input, flat image is 
            usually a measurement of the halogen lamp with counts level
            as close as possible - and well within a factor of 2 - to
            those in the astronomical frames. At longer wavelengths the
            sky is so bright that you may use the sky itself as flat source.
\on\exs
Examples:
\ex
            FLAT/IRS halo0001 0 flat1
\xe\ex
            FLAT/IRS halo0002 dark1 flat2 v=1000 l=1
\xe\ex
            FLAT/IRS halo0003 0 flat3 t=0.3 v=50 
              (note that l=.. t=.. v=.. are enough for load=.. thres=... 
               vignet=..)
\xe\sxe






