%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.IDENT      concatenateiue.hlq
%.AUTHOR     AF - INSA, VILSPA
%.KEYWORDS   MIDAS, help files
%.PURPOSE    On-line help file for the command: CONCATENATE/IUE
%.VERSION    1.0  14-JUL-1994 : Creation, AF 
%----------------------------------------------------------------
\se
SECTION./IUE
\es\co
CONCATENATE/IUE                                                14-JUL-1994  AF
\oc\su
CONCATENATE/IUE tab_in tab_out [start,end,step] [con_flag] [camera] [:flux]
    Rebins IUE High Disp MIDAS spectra and connects overlapping orders 
\us\pu

Purpose:
    Rebins IUE High Disp MIDAS spectra and connects overlapping orders. 

        Description: \\
        This command reads an IUE High Dispersion MIDAS table, computes the
        valid wavelength range for each order according to the concatenation 
        flag, sorts the valid selected points and rebins  the flux column of 
        the input table with the step as binsize. Finally, the output table 
        is created holding the wavelength, flux and epsilons columns.  

\up\sy

Syntax:    
    CONCATENATE/IUE tab_in tab_out [start,end,step] [con_flag] [camera] [:flux]

\ys\pa
         tab_in         = Input table name of the IUE High Dispersion extracted
                          spectrum        

\ap\pa

         tab_out        = Output table name                             

\ap\pa
         start,end,step = Wavelength limits and binsize for the output table.
                          Defaults values :                            \\     
                          for camera SWP      [1100.,2000.,0.1] and
                          for cameras LWP/LWR [1900.,3200.,0.1]          

\ap\pa
         con_flag       = Concatenation flag. \\
                          It is one letter code which defines the cut
                          wavelength to connect overlapping orders.     
                                     
                                                                             
                        - O ptimal, DEFAULT.                      \\            
                          The cut wavelength depends on the camera.   
                          In the  SWP camera the  end of an order has a worse 
                          S/N  ratio than the beginning of the next one,
                          so the cut is chosen close to the order end. 
                          Conversely for the LWP and LWR cameras       \\

                        - L eft,     cut wavelength  = min(m-1)              \\ 
                        - R ight,    cut wavelength  = max(m)                \\
                        - C enter,   cut wavelength  = (max(m) + min(m-1))/2 \\
                        - E chelle,  NOT recommended.                        
                          
            Scheme : Note that the order number m decreases with wavelength \\ 
            {\tt                                                          
            Order m  \ \  >------------------+                      \\
            Order m-1 \ \ \ \ \ \ \ \ \ \ \ \  +------------------>   \\
            Cut  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ + \ \ + \ \ +    \\
            Flag  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L \ \ C \ \ R      }

\ap\pa  
         camera        = Camera name SWP/LWP/LWR  or cam. number 1/2/3      \\
                         Not necessary if the input table name begins with    
                         SWP,LWP or LWR.                                    

\ap\pa    
         :flux         = Name of the flux column name to be rebinned. 
                         The default is :FLUX                            
                    
\ap\no
Note:        
        The output table holds the following columns:                     \\
       :WAVELENGTH        Wavelength in Angstrom (F8.3)                   \\ 
       :FLUX              Rebinned flux          (E12.4)                  \\ 
       :EPSILON           Quality flag           (I5)                     

       The rebinned flux is the average of the input flux value into the bin.
       If there is no pixels inside the bin, (not overlapping orders or 
       oversampled output table), the flux value is left NULL.             \\
       A bin is flagged as bad (negative value) if the fraction of bad pixels 
       into this bin is greater than 1/10. 

\on\exs
Examples:
\ex
     CONCATENATE/IUE  LWP12345  LWP12345R  
    	    LWP12345R table holds the flux of the SWP12345 table sampled in a 
            regular wavelength grid. 
\xe\ex
     CONCATENATE/IUE  SWP12345  CIV  1530,1570,0.1 
	    Creates the CIV table holding the rebinned flux of the SWP12345
            High Dispersion spectrum from  1530 to 1570 A, with a binsize of
            0.1 A. The Optimal flag, default, is used for the order 
            concatenation.      
\xe\ex
     CONCATENATE/IUE  IN  OUT  2100,2600,5  C  LWR  :GROSS
            OUT table  contains the rebinned :GROSS column of the IN table
            between 2100-2600 A with a binsize of 5 A. The order concatenation
            is made at the center of the overlapping regions.      
\xe\sxe
