% @(#)defineirsp.hlq	19.1 (ESO-IPG) 02/25/03 14:23:16 
% @(#)
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1992 European Southern Observatory
%.IDENT      defineirsp.hlq
%.AUTHOR     E.Oliva, Arcetri (Florence)
%.KEYWORDS   MIDAS, help files, DEFINE/IRSPEC
%.PURPOSE    On-line help file for the command: DEFINE/IRSPEC
%.VERSION    1.0  21-SEP-1992 : Creation, E.Oliva
%----------------------------------------------------------------
\se
SECTION./IRSPEC
\es\co
DEFINE/IRSPEC                                         21-SEP-1992 EO
\oc\su
DEFINE/IRSPEC image table [mode] [threshold]  [number] [load_option]
        Define fixed pattern of bad pixels and store it into a table.
\us\pu
Purpose:    The IRSPEC array has a fixed pattern of bad pixels which
            can be corrected using BADPIX/IRSPEC once the positions
            of the bad pixels are stored in a table.  
            This command is used to define the bad pixels and store
            their positions into a given table, which can be then
            selected using SET/IRSPEC badpix=.....
            Note that a "standard" table of bad pixels (named  
            --  irsbadpix -- ) is automatically created after the 
            SET/CONT IRSPEC command and is used by default.
\up\sy
Syntax:     DEFINE/IRSPEC in_ima out_tab [mode=selection_mode] [t=threshold] 
              [n=\#of_subframes] [load=load_option]
\ys\pa
            in_ima  =  input image (usually a dark frame). Must have the 
                       original size with starts and steps all equal to 1.
                       Untouched on exit.
\ap\pa
            out_tab =  name of the output table containing the coordinates
                       of the bad pixels.\\
\\
            Additional parameters and options:
\ap\pa 
            selection_mode = \\r,a.
                       If = r (relative, the default) the command select the 
                       bad pixels as those with 
                       \ \ \   abs(value-average) > threshold*sigma
                       where "threshold" is the next parameter while "average"
                       and "sigma" are the corrected mean and  standard 
                       deviation of a subsection of the image whose size is 
                       defined by the second next parameter.
                       If = a (absolute) the bad pixels will be those with
                       \ \ \ value<threshold(1) or value>threshold(2)
                       where "threshold(1:2)" are the next parameter.
\ap\pa
            threshold = number[,number].
                       If mode=r  a single number (default=15)
                       if mode=a  two numbers separated by a comma
\ap\pa
            \#of_subframes = integer_number.
                       Used only when mode=r, in which case the "average"
                       and "sigma" defined above are separately computed 
                       in NxN subframes 
\ap\pa
            load_option = 0 or 1.
                       If = 1 (defaults) it displaies the positions of the
                       bad pixels found. Use l=0 to force the command to work 
                       silently.
\ap\no
Note:       You will probably find it easier to understand the role of
            the additional parameters by trying to use them rather than 
            reading the above descriptions.
\on\exs
Examples:
\ex
            DEF/IRS dark01 badpix1
\xe\ex
            DEF/IRS dark01 badpix2 mode=a t=9 n=4
\xe\ex
            DEF/IRS dark01 badpix3 mode=r t=30,900
\xe\sxe


