% @(#)testtaccd.hlq	19.1 (ESO-SDAG) 02/25/03 14:16:58
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1994 European Southern Observatory
%.IDENT      testtaccd.hlq
%.AUTHOR     RHW, SDAG/ESO
%.KEYWORDS   MIDAS, ccd package, linearity, CCD testing
%.PURPOSE    On-line help file for the command: TESTTA/CCD
%.VERSION    940620 RHW created
%.VERSION    940817 RHW Split in single procedures
%---------------------------------------------------------------------
\se
SECTION./CCD
\es\co
TESTTA/CCD                                                      14-Jul-1994 RHW
\oc\su
TESTTA/CCD in_cat [out_id] [area] [tim_int] [select]
	Do linearity and transfer tests on a catalogue of flat frames
\us\pu
Purpose:    
	Do linearity and transfer tests on a catalogue of flat frames
\up\sy
Syntax:     
	TESTTA/CCD in_cat [out_id] [area] [tim_int] [select] 
\ys\pa
        in_cat =  input (with the extension .cat) catalogue of frames to be 
                  combined. The catalogues in assumed to contain a number of
                  pairs of frames with equal exposure times. The pairs should
                  be obtained at various exposure times. Therefore, there 
                  should be an even number (> 0) of entries in the catalogue.
                  The first frames in each set will belong to the group
                  "frames 1"; the second frames to group "frames 2".\\
                  No default
\ap\pa 
        out_id =  output identifier for the output of the test prodedure. 
                  All output (i.e. frames, listings and plots) will start 
                  with this identifier. Default is TRANS.
\ap\pa
        area =    area of the input frame in which the data should be taken 
                  for the median and variance determinations. Default is whole
                  image area.

\ap\pa  tim_int = interval in second within which the shutter offset will 
                  be dtermined. Default is -2,2.
\ap\pa  
        select =  selection criterim to include/exclude entries in the 
                  transfer/linearity table (see below) from the tests. 
\ap\no
Note:
        This command requires a value for the mean bias level in the keyword 
        BIASMEAN to be filled and hence should be executed after the command 
        TESTBA/CCD or TESTB5/CCD. If no value or the value zero is found no 
        bias offset will be subtracted.
\\
        The command will do the following test on the frame in the input 
        catalogue:\\
        Test T1: Creation of the transfer/linearity table.\\
                 The table will contain 5 columns: column 1 for the exposure 
                 time of the first of each sets (frames 1) (label :Exp_tim1);
                 column 2 the exposure time of the second frames (frames 2) 
                 (:Exp_tim2); column 3 the median pixel intensities over the 
                 selected frame sections in frames 1 (:Med_cnt1); column 4 
                 the median pixel intensities over the selected area in
                 frames 2 (:Med_cnt2) ; column 5 the variance of the 
                 difference of the frames 1 and 2 (:Variance). 
\\
        Test T2: Determination of linearity curve and the shutter error and 
                 the shutter offset.\\
                 Entries in the linearity table not fullfilling the selection
                 criteria select will now be selected out. From the remaining
                 entries in the table a linear fit is done to determine the 
                 linearity curve for frames 1 and 2 and the shutter error.\\
                 Using the linearity data the fractional count rates are 
                 plotted against the median counts, appying a shutter offset 
                 in the measured exposure times. The real shutter offset is 
                 determined by the value for which the fit give the minimum
                 mean residual.\\
\\
        Test T3: Determination of the transfer curve.\\
                 From the selected entries the table a linear regression
                 analysis is done to determine the analog to digital 
                 conversion factor and the electronic readout noise. The 
                 readout noise is determined by the inverse of the slope  
                 between the median and the variance multiplied by the sigma
                 of the bias (determined by TESTBA/CCD OR TESTB5/CCD and 
                 stored in keyword BIASSIGM).\\
\\
        To avoid unnecessary computations the command checks for the presence 
        of the table and will not created a new one if it is present. 
\\
        Single tests on the flat frames can be executed using the commands 
        TESTTn/CCD with n = 1, 2 or 3.
\on\op
Output:
\\
        The command will stored the outputs in a number of ascii and 
        postscript files (preceding by the identification string out_id):\\
           'out_id'.tbl        MIDAS table containing exposure times, median
                               counts rates, etc, used for the analysis.
           `out_id'_table.txt: table listing;\\
           `out_id'_lin1.ps:   postscript plot with lin. tests using all 
                               data;\\
           `out_id'_lin2.ps:   postscript plot with lin. tests using selected
                               data;\\
           `out_id'_trans.ps:  postscript plot with transfer curves using 
                               selected data.
\\
        The keyword ADUCF and ENOISE are filled with the ADU conversion 
        factor and the electronic noise (in electons/pixel).
\po\see
See also:   
        TESTTn/CCD, TESTBA/CCD, SET/CCD, SHOW/CCD, SELECT/TAB
\ees\exs
Examples:
\ex
        TESTTA/CCD efosc.cat TRANS [@900,@900:@1100,@1100] :Var_diff.GT.1000
        Run the complete test procedure on frames in the catalogue efosc.cat. 
        Create a table with all frames include and sort the table according
        to increasing exposure time. Then start doing the analysis.
\xe \sxe





















