% @(#)merge_eche.hlq	19.1 (ESO-IPG) 02/25/03 14:18:36 
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990 European Southern Observatory
%.IDENT      merge_eche.hlq
%.AUTHOR     JDP, IPG/ESO
%.KEYWORDS   MIDAS, help files, MERGE/ECHELLE
%.PURPOSE    On-line help file for the command: MERGE/ECHELLE
%.VERSION    1.0  17-DEC-1986 : Creation, JDP
%            1.1  05-OCT-1999 : optimal merging (SW)
%----------------------------------------------------------------
\se
SECTION./ECHE
\es\co
MERGE/ECHELLE						05-OCT-1999 SW
\oc\su
MERGE/ECHELLE inframe outframe [params] [method]
	merge echelle orders
\us\pu
Purpose:    
            Produces a 1-D spectrum, from the order by order file generated
            by REBIN/ECHELLE.
            Two methods are available:
            NOAPPEND individual orders are separated in 1D files
            AVERAGE  the orders are merged into a 1D file, the algorithm
                     computes a weighted average in the overlapping region
                     of adjacent orders. The normalized weight is a linear
                     ramp between 0 and 1 in the overlapping region.
            OPTIMAL  the orders are merged into a 1D file, the algorithm
                     computes a weighted average in the overlapping region
                     of adjacent orders. Specify the weights to be used by
                     P5 which have to have the same START and STEP as the
                     input frame.

\up\sy
Syntax:     MERGE/ECHELLE inframe outframe [params] [method] [weights]
\ys\pa
            inframe  = input image, sampled in the space wavelength-order
                       Corresponds to a extracted and rebinned spectrum.
\ap\pa
            outframe = one dimensional spectrum, sampled in wavelengths.
                       Values in the overlapped region are computed
                       according to the method
\ap\pa
            params   = method NOAPPEND : order numbers (ord1,ord2).
                       method AVERAGE  : wavelength interval to be skipped
                                         at both edges of the overlapping
                                         region. Default is 3 Angstroem.
                       Echelle keywords are DELTA (if MRGMTD=AVERAGE) or
                       MRGORD (if MRGMTD=NOAPPEND).
\ap\pa
            method   = optional parameter to define the overlapping region
                       of the orders as:
                       NOAPPEND : get individual orders as 1D files.
                       AVERAGE  : merge all the orders into a 1D file.
                                  Default method.
                       OPTIMAL  : merge all the orders into a 1D file
                                  using weights specified by P5
                       Echelle keyword is MRGMTD. Default is AVERAGE
\ap\pa
            weight   = parameter to define the weights for the optimal
                       merging (only used with MRGMTD=OPTIMAL).
\ap\no
Note:       none

\on\exs
Examples:
\ex
            MERGE/ECHELLE extr1 spec1 3. AVERAGE
\xe\ex
            MERGE/ECHELLE extr1 spec_opt 5. OPTIMAL weights
\xe \sxe
