IDL Help for ESI Stuff

This page was created by the IDL library routine make_html_help. For more information on this routine, refer to the IDL Online Help Navigator or type:

     ? make_html_help

at the IDL command line prompt.

Last modified: Tue Feb 11 09:59:04 2003.


List of Routines


Routine Descriptions

ESI_ADDTWO

[Next Routine] [List of Routines]
 NAME:
 esi_addtwo
   Version 1.0

 PURPOSE:
    Combines two flats, rejecting Cosmic Rays

 CALLING SEQUENCE:
   
   img = esi_addtwo(esi, indx, VAR=var)

 INPUTS:
   esi
   indx

 RETURNS:
   img       - Combine image

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:
   VAR       - Variance

 COMMENTS:

 EXAMPLES:
   img = esi_addtwo(esi, indx)


 PROCEDURES CALLED:

 REVISION HISTORY:
   28-Aug-2002 Written by JXP

(See ESI/pro/General//esi_addtwo.pro)


ESI_AR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_ar   
     Version 1.1

 PURPOSE:
   Reads in the first file in the directory with 'esi*fits'

 CALLING SEQUENCE:
   
  esi = esi_ar(file)

 INPUTS:
    [file] - Filename (default: first file in list ./esi_*fits*)

 RETURNS:
    esi -  ESI structure

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi = esi_ar()


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   13-Nov-2001 Written by JXP
   03-Feb-2003 Polished (JXP)

(See ESI/pro/General//esi_ar.pro)


ESI_DELFIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_delfin   
     Version 1.0

 PURPOSE:
    Deletes Final images

 CALLING SEQUENCE:
   
  esi_delfin, esi, indx

 INPUTS:
   esi   -  ESI structure
   indx  -  Index numbers of frames to delete

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_delfin, esi, indx


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   05-Sep-2002 Written by JXP

(See ESI/pro/General//esi_delfin.pro)


ESI_DELOV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_delov   
     Version 1.0

 PURPOSE:
    Deletes OV images

 CALLING SEQUENCE:
   
  esi_delov, esi, indx

 INPUTS:
   esi   -  ESI structure
   indx  -  Index numbers of frames to delete

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_delov, esi, indx


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   18-Jul-2002 Written by JXP

(See ESI/pro/General//esi_delov.pro)


ESI_ECHADDTWO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echaddtwo
   Version 1.0

 PURPOSE:
    Combines two flats, rejecting Cosmic Rays
    Assumes images have nearly the same exposure time

 CALLING SEQUENCE:
   
   img = esi_echaddtwo(esi, indx, VAR=var)

 INPUTS:
   esi
   indx

 RETURNS:
   img       - Combine image

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:
   VAR       - Variance

 COMMENTS:

 EXAMPLES:
   img = esi_echaddtwo(esi, indx)


 PROCEDURES CALLED:

 REVISION HISTORY:
   19-Aug-2002 Written by JXP

(See ESI/pro/ECH/General//esi_echaddtwo.pro)


ESI_ECHBADPIX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echbadpix   
     Version 1.1

 PURPOSE:
    Set bad pixels to 0

 CALLING SEQUENCE:
   
  esi_echbadpix, img

 INPUTS:
   img     - 2D IMG array

 RETURNS:

 OUTPUTS:
  Full image with badpixels suppressed

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:
   Only set for 1x1 binning for now

 EXAMPLES:
   esi_echbadpix, img

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   12-Aug-2002 Written by JXP
   03-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/General//esi_echbadpix.pro)


ESI_ECHCOADDFIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echcoaddfin  
     Version 1.1

 PURPOSE:
 Combine the individual 1D spectra from each order to create 1
 continuous spectrum.  The code attempts to match flux at the order
 ends and it is recommended that you have fluxed the obj prior to
 this step.

 CALLING SEQUENCE:
   
  esi_echcoaddfin, esi, obj_id, CRVAL1=, CDELT=, NPIX=, /STD

 INPUTS:
   esi   -  ESI structure
   obj_id   -  Object ID  (e.g. 0L, 1L, etc)

 RETURNS:

 OUTPUTS:
  One flux and one error array in 1D

 OPTIONAL KEYWORDS:
    ORDRS=    - Orders to coadd (default: [0L,9L])

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   tst_coadd, esi, indx


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   13-Oct-2002 Written by JXP
   04-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Spec//esi_echcoaddfin.pro)


ESI_ECHCOMBARC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echcombarc   
     Version 1.0

 PURPOSE:
    Process arc file

 CALLING SEQUENCE:
   
  esi_echcombarc, esi, slit

 INPUTS:
   esi     -  ESI structure

 RETURNS:

 OUTPUTS:
  One normalized flat per slit width

 OPTIONAL KEYWORDS:
   DFLAT      - Use Dome flats where possible

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echcombarc, esi


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   05-Sep-2002 Written by JXP

(See ESI/pro/ECH/Arcs//esi_echcombarc.pro)


ESI_ECHCOMBIMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echcombimg   
     Version 1.0

 PURPOSE:
    Process a data frame

 CALLING SEQUENCE:
   
  esi_echcombimg, esi, indx, /DFLAT, /REDDOV

 INPUTS:
   esi     -  ESI structure
   indx    -  Index values

 RETURNS:

 OUTPUTS:
  Fully combimgessed image

 OPTIONAL KEYWORDS:
   DFLAT      - Use Dome flats where possible

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echcombimg, esi, indx


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   19-Aug-2002 Written by JXP

(See ESI/pro/ECH/General//esi_echcombimg.pro)


ESI_ECHCOMBSPEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echcombspec
    Version 1.1

 PURPOSE:
   Combines multiple exposures of the same obj
    Must be run even on an object with a single exposure

 CALLING SEQUENCE:
   
   esi_echcombspec, esi, obj_id, exp_id

 INPUTS:
   esi      - ESI structure
   obj_id   -  Object ID  (e.g. 0L, 1L, etc)
   [exp_id] -  Exposure frames (e.g. [0L, 1L])

 RETURNS:

 OUTPUTS:
   echfspec      -  ESI fspec structure (fits file; FSpec/name_ech.fits)

 OPTIONAL KEYWORDS:
    /SILENT   - No text output
    LIST=     - Use an input list to combine (required for multiple
                night obs).  Output is in 'FSpec/tmp_ech.fits'.
    OBJ_NM=   - Name of object in slit (a = science)
    /STD      - Run on a standard star
    OUTNM=    - Alternative output name for FSpec file
    ORDRS=    - Orders to combine (default: [0L,9L])

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echcombspec, esi, obj_id, exp_id

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   02-Aug-2002 Written by JXP
   04-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Spec//esi_echcombspec.pro)


ESI_ECHCOPYFND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echcopyfnd   
     Version 1.0

 PURPOSE:
    Finds all objects and traces them

 CALLING SEQUENCE:
   
  esi_echcopyfnd, esi, obj_id

 INPUTS:
   esi   -  ESI structure
   indx  -  Indices of objects to process

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   FLAT  - Flat file
   BIAS  - Bias frame

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echcopyfnd, esi 


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   22-Jul-2002 Written by JXP

(See ESI/pro/ECH/Obj//esi_echcopyfnd.pro)


ESI_ECHEXTOBJ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echextobj   
     Version 1.1

 PURPOSE:
    Extract flux from 2D image to create ten 1D spectra (1 per order)
    Output is written to the object structure (e.g. Extract/Obj_esi0024.fits)
    The code only does boxcar extraction for now.

 CALLING SEQUENCE:
   
  esi_echextobj, esi, obj_id, [exp], /DEBUG, /CHK, /STD, APER=,
  RADIUS=

 INPUTS:
   esi   -  ESI structure
   indx  -  Indices of objects to process

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   /CHK    - Show final trace
   /STD    - Extraction should be set for a standard star
   /DEBUG  - Stop within extraction routine to check stuff
   APER=   - Set aperture by hand (e.g. [5., 7.] )
   RADIUS= - Size of window for setting aperture size (default: 20L)
   ORDRS=  - Orders to extract (default: [0L,9L])

 OPTIONAL OUTPUTS:

 COMMENTS:
  1)  The program begins extracting in order 9L (physical 6) and will
  automatically calculate an aperture for that order.  If there is
  insufficient flux in the following orders, it will adopt the value
  from the next higher order. 

 EXAMPLES:
   esi_echextobj, esi, 1L, [0L]

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   15-Aug-2002 Written by JXP
   04-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Obj//esi_echextobj.pro)


ESI_ECHFITARC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echfitarc   
     Version 1.1

 PURPOSE:
    1) Take the arc image from esi_echmkarc 
    2) Extract 1D spectra (1 per order)
    3) Determine pixel offset from archived fit
    4) Automatically identify a set of lines
    5) Create a fit to these lines, identify all lines and fit again
    6) Write arc solutions (one per order) to a fits file 

 CALLING SEQUENCE:
   
  esi_echfitarc, esi, slit, /INTER, LINLIST=, /CHK, /CLOBBER,
  SIGREJ=, /DEBUG, ORDRS=, PIXSHFT=, /PINTER

 INPUTS:
   esi     -  ESI structure
   slit    -  Slit width  (0.5, 0.75, 1.0)

 RETURNS:

 OUTPUTS:
  IDL fit file (one per order)  (e.g. Arcs/ArcECH_##fit.idl)

 OPTIONAL KEYWORDS:
   /PINTER   - Perform fit only for the pre-identified lines
              (recommended)
   /INTER    - Identify lines interactively and then fit
   LINLIST=  -  Arc line list (default:
                                $XIDL_DIR/Spec/Arcs/Lists/ESI_ech.lst)
   GUESSARC= -  Initial guess for wavelength solution (default:
                                $XIDL_DIR/ESI/CALIBS/ESI_arcfit.idl)
   /CHK      - Manually check steps along the way
   /DEBUG    - More intensive checking
   ORDRS=    - Only fit select orders (default: [0L,9L] )
   PIXSHFT=  - Manually set pixel shift from calib file (deafult:
                Let the program determine this using FFT formalism)
   SIGREJ=   - Rejection sigma for outliers in arc line fitting
              (default: 2.)
   /CLOBBER  - Overwrite previous fits
   /CUAR     - CuAr lamps only!

 OPTIONAL OUTPUTS:

 COMMENTS:
   There is some fine tuning in a couple of orders to help with the
    fits.  Only setup for 1x1 binning right now

 EXAMPLES:
   esi_echfitarc, esi, 0.5, /CHK, /PINTER, /CLOBBER


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   12-Aug-2002 Written by JXP
   21-Aug-2002 Streamlined + Added ps output
   01-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Arcs//esi_echfitarc.pro)


ESI_ECHFLTSCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echfltsct   
     Version 1.1

 PURPOSE:
    Subtracts a scattered light model from the flat
    Normalizes the Image and Outputs to same file with
    updated headers

 CALLING SEQUENCE:
   
  esi_echfltsct, esi, /IFLAT, GAIN_RTO=, /CHK

 INPUTS:
   esi     -  ESI structure
   slit    -  Slit width  (0.5, 0.75, 1.0)

 RETURNS:

 OUTPUTS:
  Image with scattered light removed (e.g. Flats/FlatECH##_D[I].fits)

 OPTIONAL KEYWORDS:
   /IFLAT    - Use internal flats 
   GAIN_RTO= - Value for gain ratio for two amp mode (default:
      calculate from image)
   /CHK      - Display final image and a few other steps
   MINWID=   - Minimum width between orders for measuring scattered light
   /PINH     - Indicates pinhole slit (used in early 2000)

 OPTIONAL OUTPUTS:

 COMMENTS:
   Only set for 1x1 binning -- Many 'hard wired' numbers

 EXAMPLES:
   esi_echfltsct, esi, 0.75, /CHK


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   11-Aug-2002 Written by JXP
   01-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Flat//esi_echfltsct.pro)


ESI_ECHFLUX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echflux
    Version 1.0

 PURPOSE:
   Fluxes esi data.  Puts in flambda units by default

 CALLING SEQUENCE:
   
   esi_echflux, esi, obj_id, [exp_id]

 INPUTS:
   esi     - WFCCD structure
   obj_id     - WFCCD structure
   [exp_id]     - WFCCD structure

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echflux, esi, obj_id, exp_id


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   22-Aug-2002 Written by JXP

(See ESI/pro/ECH/Spec//esi_echflux.pro)


ESI_ECHFLUXFIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echfluxfin  
     Version 1.1

 PURPOSE:
    Fluxes the spectrum using a standard star calibration.  Default
    is to use the one in CALIBS which is probably good enough for
    relative fluxing.  Definitely not good enough for absolute.

 CALLING SEQUENCE:
   
  esi_echfluxfin, esi, obj_id, [fluxfil], /CLOBBER, OBJ_NM=, /STD

 INPUTS:
   esi       -  ESI structure
   obj_id    -  Object ID  (e.g. 0L, 1L, etc)
   [fluxfil] -  File name of standard star for fluxing (default:
               $XIDL_DIR/ESI/CALIBS/ECH_FLUX_050.fits)

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
    ORDRS=    - Orders to flux (default: [0L,9L])

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echfluxfin, esi, obj_id, /CLOBBER


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   14-Oct-2002 Written by JXP
   04-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Spec//esi_echfluxfin.pro)


ESI_ECHFNDOBJ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echfndobj   
     Version 1.1

 PURPOSE:
    Finds all objects and traces them

 CALLING SEQUENCE:
   
  esi_echfndobj, esi, obj_id, [exp], REFWV=, SCICLM=,
  REFORDR=, /INTER, /STD, /CHK, MAXOFF=, /NOCLOB

 INPUTS:
   esi     -  ESI structure
   obj_id  -  Object ID  (e.g. 0L, 1L, etc)
   [exp]   -  Exposure frames (e.g. [0L, 1L])

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
  /STD     - Find object for standard star
  /CHK     - Show overall trace
  FITFIL=  - Map of pinholes (default: Maps/hole_fit.idl )
  REFWV=   - Reference wavelength region (default: [5600., 5610.] )
  REFORDR= - Reference order  (default: 4L)
  /INTER   - Interactively identify objects and set apertures
             (recommended)
  MAXOFF=  - Minimum offset between max obj and center of slit
             (default: 20.)
  

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echfndobj, esi, 0L, [0L, 1L], /CHK, /INTER, 
      REFWV=[6500., 6520.], REFORDR=5L


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   22-Jul-2002 Written by JXP
   03-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Obj//esi_echfndobj.pro)


ESI_ECHGETTRC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echgettrc   
     Version 1.0

 PURPOSE:
    Subtracts a gettrcered light model from the data
    Outputs to the same image (usually OV/ov_esi####.fits)

 CALLING SEQUENCE:
   
  esi_echgettrc, esi, /DFLAT

 INPUTS:
   esi     -  ESI structure

 RETURNS:

 OUTPUTS:
  Image with gettrcered light removed

 OPTIONAL KEYWORDS:
   DFLAT      - Use Dome flats where possible

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echgettrc, esi


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   07-Aug-2002 Written by JXP

(See ESI/pro/ECH/Map//esi_echgettrc.pro)


ESI_ECHMKAIMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echmkaimg   
     Version 1.1

 PURPOSE:
    Creates a wavelength image given the arc trace

 CALLING SEQUENCE:
   
  esi_echmkaimg, esi, slit, TRCSTR=, NX=, NY=, /CHK

 INPUTS:
   esi     -  ESI structure
   slit    -  Slit width  (0.5, 0.75, 1.0)

 RETURNS:

 OUTPUTS:
  One wavelength map for the given slit size 
     (e.g. Arcs/Arc/ECH_##IMG.fits)

 OPTIONAL KEYWORDS:
   /CHK     - Manually check steps along the way
   TRCSTR=  - Trace structure for fitting
   NX, NY=  - Order of x,y 2D poly fit (default: 9,3)
   /CUAR    - CuAr lamps only!

 OPTIONAL OUTPUTS:

 COMMENTS:
  Only setup for 1x1 binning (some hard numbers)
  Zeros out image for rows [0-1500] in order 15; [2170-end] in order6

 EXAMPLES:
   esi_echmkaimg, esi, 1.0, /CHK

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   13-Aug-2002 Written by JXP
   03-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Arcs//esi_echmkaimg.pro)


ESI_ECHMKARC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echmkarc   
     Version 1.1

 PURPOSE:
    Process and combine arc files  

 CALLING SEQUENCE:
   
  esi_echmkarc, esi, slit, /CLOBBER

 INPUTS:
   esi     -  ESI structure
   slit    -  Slit width  (0.5, 0.75, 1.0)

 RETURNS:

 OUTPUTS:
  One processed, combined Arc Image (e.g. Arcs/Arc_ECH##.fits)

 OPTIONAL KEYWORDS:
   /CLOBBER - Overwrite exisiting arc image

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echmkarc, esi, 0.5


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   12-Aug-2002 Written by JXP
   01-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Arcs//esi_echmkarc.pro)


ESI_ECHMKFLAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echmkflat   
     Version 1.1

 PURPOSE:
    Identifies flats, processes them.  Creates one flat file
      per slit width.  Takes Dome flats as the default

 CALLING SEQUENCE:
   
  esi_echmkflat, esi, /IFLAT

 INPUTS:
   esi     -  ESI structure
   [slit]  -  Slit size (e.g. 0.5, 0.75, 1.0)

 RETURNS:

 OUTPUTS:
  One normalized flat per slit width

 OPTIONAL KEYWORDS:
   /IFLAT   - Use internal flats
   /REDOOV  - Overwrite OV files if they exist for the flats
   /SVOV    - Save the OV files created during this step

 OPTIONAL OUTPUTS:

 COMMENTS:
  Only set for 1x1 binning

 EXAMPLES:
   esi_echmkflat, esi, 1.0

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   04-Aug-2002 Written by JXP
   01-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Flat//esi_echmkflat.pro)


ESI_ECHMKMAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echmkmap   
     Version 1.0

 PURPOSE:
    Process arc file

 CALLING SEQUENCE:
   
  esi_echmkmap, esi, slit

 INPUTS:
   esi     -  ESI structure

 RETURNS:

 OUTPUTS:
  One normalized flat per slit width

 OPTIONAL KEYWORDS:
   DFLAT      - Use Dome flats where possible

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echmkmap, esi


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   13-Aug-2002 Written by JXP

(See ESI/pro/ECH/Map//esi_echmkmap.pro)


ESI_ECHMKSKY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echmksky   
     Version 1.0

 PURPOSE:
    Create a Sky array from the sky fits

 CALLING SEQUENCE:
   
  esi_echmksky, esi, obj_id

 INPUTS:
   esi   -  ESI structure
   indx  -  Indices of objects to process

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   FLAT  - Flat file
   BIAS  - Bias frame

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echmksky, esi 


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   19-Nov-2002 Written by JXP

(See ESI/pro/ECH/Skysub//esi_echmksky.pro)


ESI_ECHOBJCR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echobjcr   
   Version 1.0

 PURPOSE:
    Flags CRs given 2 or more object images

 CALLING SEQUENCE:
   
   esi_echobjcr, esi, obj_id

 INPUTS:
   struct -- esi_echstrct defining the images of interest

 RETURNS:

 OUTPUTS:
   flat - fits file in the dir Flats named 'Flat_##.fits'
                 where ## is the mask_id value
   VAR  - Variance in the flat (in electrons)

 OPTIONAL KEYWORDS:
   SVOV - save ov files
   NOFITS - No FITS output

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echobjcr, esi, 0L


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   06-Sep-2002 Written by JXP

(See ESI/pro/ECH/Obj//esi_echobjcr.pro)


ESI_ECHPROC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echproc   
     Version 1.1

 PURPOSE:
    Process a data frame

 CALLING SEQUENCE:
   
  esi_echproc, esi, indx, /IFLAT, /REDDOV

 INPUTS:
   esi     -  ESI structure
   indx    -  Index values

 RETURNS:

 OUTPUTS:
  Fully processed image

 OPTIONAL KEYWORDS:
  /SVOV    - Save OV files
  /REDOOV  - Redo OV subtraction
  /CLOBBER - Clobber existing image
  /SUBSCAT - Subtract scattered light from data image

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echproc, esi, [20L], /CLOBBER


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   12-Aug-2002 Written by JXP
   03-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/General//esi_echproc.pro)


ESI_ECHPSKYSUB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echpskysub   
     Version 1.0

 PURPOSE:
    Sky Subtract image

 CALLING SEQUENCE:
   
  esi_echpskysub, esi, obj_id

 INPUTS:
   esi   -  ESI structure
   indx  -  Indices of objects to process

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   FLAT  - Flat file
   BIAS  - Bias frame

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echpskysub, esi 


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   17-Oct-2002 Written by JXP

(See ESI/pro/ECH/Skysub//esi_echpskysub.pro)


ESI_ECHRDXSTD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echrdxstd   
     Version 1.0

 PURPOSE:
    Trace a standard star in each ordrer

 CALLING SEQUENCE:
   
  esi_echrdxstd, esi, /DFLAT

 INPUTS:
   esi     -  ESI structure

 RETURNS:

 OUTPUTS:
  Image with rdxstdered light removed

 OPTIONAL KEYWORDS:
   DFLAT      - Use Dome flats where possible

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echrdxstd, esi


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   18-Dec-2002 Written by JXP

(See ESI/pro/ECH/Std//esi_echrdxstd.pro)


ESI_ECHSETUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echsetup   
     Version 1.1

 PURPOSE:
    Creates and outputs a structure for a series of ESI
    spectroscopic images

 CALLING SEQUENCE:
   
  esi_echsetup, esi

 INPUTS:

 RETURNS:

 OUTPUTS:
   esi --  ESI structure

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echsetup, esi, OUTFIL=


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   17-Jul-2002 Written by JXP
   29-Jan-2003 Polished by JXP

(See ESI/pro/ECH/General//esi_echsetup.pro)


ESI_ECHSKYSUB[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echskysub   
     Version 1.0

 PURPOSE:
    Sky Subtract image

 CALLING SEQUENCE:
   
  esi_echskysub, esi, obj_id

 INPUTS:
   esi   -  ESI structure
   indx  -  Indices of objects to process

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   FLAT  - Flat file
   BIAS  - Bias frame

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echskysub, esi 


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   22-Jul-2002 Written by JXP
   10-Oct-2002 Revised: Saving bset + allows single order redo

(See ESI/pro/ECH/Skysub//esi_echbskysub.pro)


ESI_ECHSKYSUB[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echskysub   
     Version 1.1

 PURPOSE:
    Sky Subtract image and add sky subtracted frame to the final
    image (e.g. Final/f_esi0020.fits).  The program also outputs
    information related to the sky fit in the Sky directory.  The
    user has control over which order to subtract (ORDR=), the
    wavelength image to use (AIMG=) and can input a break point file
    for detailed sky line subtraction (SKLFIL=).

 CALLING SEQUENCE:
   
  esi_echskysub, esi, obj_id, [exp], /CHK, /STD, ORDR=, /NOVAC,
  SKLFIL=, BORDR=, AIMG=

 INPUTS:
   esi   -  ESI structure
   obj_id  -  Object ID  (e.g. 0L, 1L, etc)
   [exp]   -  Exposure frames (e.g. [0L, 1L])

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
  /STD     - Sky subtract standard star
  /CHK     - Show steps along the way
  AIMG=    - Use alternate Wavelength map for sky subtraction
             (string filename)
  ORDR=    - Sky subtract a single order only (e.g.  5L)
  /NOVAC   - Do not perform vacuum wavelength correction
  BORDR=   - Order to begin bspline fitting (default: 5L)
  SKLFIL=  - ASCII file setting breakpoints around sky lines (string)
  /CLOBBER - Overwrite any previos sky image

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echskysub, esi, 1L, [0L], /CHK, ORDR=7L   
           {Sky sub exposure 0 and order 7 only}

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   22-Jul-2002 Written by JXP
   10-Oct-2002 Revised: Saving bset + allows single order redo
   04-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Skysub//esi_echskysub.pro)


ESI_ECHSPECPLT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echspecplt   
   Version 1.0

 PURPOSE:
    Plots any array interactively

 CALLING SEQUENCE:
   
   esi_echspecplt, ydat, [head], XSIZE=, YSIZE=, TITLE=, WAVE=, LLIST=,
           QAL=, ERR=, /GAL

 INPUTS:
   ydat       - Values 
   [head]     - Header

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   xsize      - Draw window xsize (pixels)
   ysize      - Draw window ysize (pixels)
   wave       - wavelength array
   ERR        - Error array (fits or image)

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echspecplt, 'spec.fits'


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   23-Aug-2002 Written by JXP

(See ESI/pro/ECH/Spec//esi_echspecplt.pro)


ESI_ECHSUBSCAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echsubscat   
     Version 1.0

 PURPOSE:
    Subtracts a scattered light model from the image

 CALLING SEQUENCE:
   
  esi_echsubscat, esi, /DFLAT

 INPUTS:
   esi     -  ESI structure

 RETURNS:

 OUTPUTS:
  Image with scattered light removed

 OPTIONAL KEYWORDS:
   DFLAT      - Use Dome flats where possible

 OPTIONAL OUTPUTS:

 COMMENTS:
   Not well tested

 EXAMPLES:
   esi_echsubscat, esi


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   11-Aug-2002 Written by JXP

(See ESI/pro/ECH/General//esi_echsubscat.pro)


ESI_ECHTRCARC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echtrcarc   
     Version 1.1

 PURPOSE:
    Takes the arc, creates a fit and traces the lines.

 CALLING SEQUENCE:
   
  esi_echtrcarc, esi, slit, LINLIST=, /CHK, /AUTO, ORDR=

 INPUTS:
   esi     -  ESI structure
   slit    -  Slit width  (0.5, 0.75, 1.0)

 RETURNS:

 OUTPUTS:
  One normalized flat per slit width

 OPTIONAL KEYWORDS:
   /AUTO     - Perform steps automatically (recommended)
   ORDR=     - Only fit select order [one at a time]
   /CHK      - Manually check steps along the way
   /DEBUG    - More intensive checking
   LINLIST=  - Arc line list (default:
                                $XIDL_DIR/Spec/Arcs/Lists/ESI_ech.lst)
   GUESSARC= -  Initial guess for wavelength solution (default:
                                $XIDL_DIR/ESI/CALIBS/ESI_arcfit.idl)
   /NO11KLDG - Turn off the kludge in order 11.  Only do this if the
       arc image is very good (long CuAr exposures)
   PIXSHFT=  - Manually set pixel shift from calib file (deafult:
                Let the program determine this using FFT formalism)
   PKSIG=    - Number of sigma for peaks to use in tracing 
               (default: 7.)
   /CUAR     - CuAr lamps only!
   /KLUDGE   - Force kludging of bottom end

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echtrcarc, esi, 0.5, /CHK, /AUTO


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   12-Aug-2002 Written by JXP
   21-Aug-2002 Streamlined + ps output
   01-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Arcs//esi_echtrcarc.pro)


ESI_ECHTRCHOLES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echtrcholes   
     Version 1.1

 PURPOSE:
    Traces the pinhole images in each order to create a curvature
    map useful for data reduction.  

 CALLING SEQUENCE:
   
  esi_echtrcholes, esi, IMG=, XERR=, FITFIL=, FIT=,
        GDENDS=, HOLEFIL=

 INPUTS:
   esi     -  ESI structure

 RETURNS:

 OUTPUTS:
  fitfil -- Name of IDL fit to pinhole traces (default:
            Maps/hole_fit.idl)
  holefil --  Name of combined pinhole image  (default:
             Maps/img_hole.fits)

 OPTIONAL KEYWORDS:
  IMG -- Name of pinhole image file  (default is to combine all
         pinhole frames)
  CLOBBER -- Overwrite existing map file

 OPTIONAL OUTPUTS:

 COMMENTS:
   1) The current version works only with data taken from April 2000 -
   present.  
   2) Only setup for standard 1x1 binning

 EXAMPLES:
   esi_echtrcholes, esi

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   07-Aug-2002 Written by JXP
   01-Feb-2003 Polished by JXP

(See ESI/pro/ECH/Map//esi_echtrcholes.pro)


ESI_ECHTRCOBJ

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echtrcobj   
     Version 1.1

 PURPOSE:
    Trace the object through each order of the image.  The program
    uses a standard star as a crutch (/STD) through regions where the object
    has very low flux.  The trace is written into the object
    structure (e.g. Extract/Obj_esi0024.fits)

 CALLING SEQUENCE:
   
  esi_echtrcobj, esi, obj_id, [exp_id], /STD, /FAINT, /CHK, NCOLL=

 INPUTS:
   esi     -  ESI structure
   obj_id  -  Object ID  (e.g. 0L, 1L, etc)
   [exp_id]   -  Exposure frames (e.g. [0L, 1L])

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   /CHK    - Show final trace
   /STD    - Use standard star as a crutch
   /FAINT  - Faint object; sum up more rows (40) to search for flux 
   NCOLL=  - Set number of rows to sum by hand (default: 25)

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echtrcobj, esi, 1L, [0L], /CHK, /STD


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   19-Aug-2002 Written by JXP
   04-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Obj//esi_echtrcobj.pro)


ESI_ECHTRCSTD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echtrcstd   
     Version 1.1

 PURPOSE:
    Trace a standard star in each ordrer

 CALLING SEQUENCE:
   
  esi_echtrcstd, esi, /DFLAT

 INPUTS:
   esi     -  ESI structure
   slit    -  Slit width  (0.5, 0.75, 1.0)

 RETURNS:

 OUTPUTS:
  Image with trcstdered light removed

 OPTIONAL KEYWORDS:
  /NOFND   - Do not repeat step to find object
  /NOSKY   - Do not repeat sky subtraction
  /CHK     - Show the final trace
  MXERR=   - Maximum error in trace centering to include 
                 (default: 0.3 pix)
  OFF=     - Offset used in find object routine
  /CUAR    - Data has only CuAr lamps

 OPTIONAL OUTPUTS:

 COMMENTS:
  Only setup for 1x1 binning (some hard numbers)

 EXAMPLES:
   esi_echtrcstd, esi, 1.0, /CHK

 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   18-Aug-2002 Written by JXP
   03-Feb-2003 Polished (JXP)

(See ESI/pro/ECH/Std//esi_echtrcstd.pro)


ESI_ECHUPDATRC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_echupdatrc   
     Version 1.0

 PURPOSE:
    Takes the arc, creates a fit and traces the lines.

 CALLING SEQUENCE:
   
  esi_echupdatrc, esi, slit, /DFLAT

 INPUTS:
   esi     -  ESI structure

 RETURNS:

 OUTPUTS:
  One normalized flat per slit width

 OPTIONAL KEYWORDS:
   DFLAT      - Use Dome flats where possible

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_echupdatrc, esi, slit


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   05-Sep-2002 Written by JXP

(See ESI/pro/ECH/Arcs//esi_echupdatrc.pro)


ESI_EDITSTRCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_editstrct   
   Version 1.1

 PURPOSE:
    Launches a gui to edit the ESI structure

 CALLING SEQUENCE:
   
   esi_editstrct, esi

 INPUTS:
  esi  --  ESI structure

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_editstrct, esi


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   04-Jan-2002 Written by JXP
   29-Jan-2003 Polished by JXP

(See ESI/pro/General//esi_editstrct.pro)


ESI_MKZERO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_mkzero   
     Version 1.1

 PURPOSE:
    Create bias frames from zero exposures
    Default is to create both IMG and SPEC bias frames

 CALLING SEQUENCE:
   
  esi_mkzero, esi, /NOSPEC, /NOIMG, MMEM=

 INPUTS:
   esi   -  ESI structure

 RETURNS:

 OUTPUTS:
   Creates bias frames in 'Bias/BiasS.fits' and 'Bias/BiasI.fits'
    for spectroscopy and imaging respectively

 OPTIONAL KEYWORDS:
    /NOSPEC -- Dont create spectroscopy bias
    /NOIMG -- Dont create image bias
    MMEM= -- Maximum memory to use in combining zero flats

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_mkzero, esi, /NOIMG


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   17-Jul-2002 Written by JXP
   29-Jan-2003 Polished by JXP

(See ESI/pro/General//esi_mkzero.pro)


ESI_SLITNM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_slitnm   
     Version 1.0

 PURPOSE:
    Process an image (bias subtract + flatten)
      WARNING! Assumes 1 bias and 1 flat for all images

 CALLING SEQUENCE:
   
  nm = esi_slitnm( slit )

 INPUTS:
   slit   -  Slit size

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   nm = esi_slitnm( slit ) 


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   19-Jul-2002 Written by JXP

(See ESI/pro/General//esi_slitnm.pro)


ESI_STRCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_strct   
     Version 1.1

 PURPOSE:
    Creates and outputs a structure for a series of ESI frames
    This structure organizes the data for the night and is used 
    to run most of the programs in the ESI package    

 CALLING SEQUENCE:
   
  esi_strct, struct, LIST=, /MKDIR, /NOFILE, OUTFIL=, /NOEDIT

 INPUTS:

 RETURNS:

 OUTPUTS:
   struct     -  IDL structure 

 OPTIONAL KEYWORDS:
   LIST       - Image list:  e.g.  'gd_files.lst'
              Default is 'Raw/esi*.fits'
   MKDIR      - Make directories
   NOEDIT     - Do not edit the hand
   OUTFIL     - Name of fits output file
   

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_strct, nght1_strct, /MKDIR


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   11-Jul-2002 Written by JXP
   29-Jan-2003 Polished by JXP

(See ESI/pro/General//esi_strct.pro)


ESI_SUBBIAS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_subbias   
     Version 1.1

 PURPOSE:
    Median combine all ZRO frames (darks)
      WARNING!  Assumes images are all of 1 mode (e.g. IMG, ECH, LWD)!!

 CALLING SEQUENCE:
   
  esi_subbias, esi, indx

 INPUTS:
   esi   -  ESI structure
   indx  -  Index numbers of frame to subtract (default output is OV)

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
  BIASFIL= - Name of bias file (default: Bias/BiasS[I].fits)
  OVROOT=  - Root name of OV file (default: OV/ov_ )
  /FORCE   - Overwrite existing OV files 

 OPTIONAL OUTPUTS:

 COMMENTS:
  Currently only good for 1x1 binning

 EXAMPLES:
   esi_subbias, esi, [47L,48L,49L]


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   17-Jul-2002 Written by JXP
   01-Feb-2003 Polished (JXP)

(See ESI/pro/General//esi_subbias.pro)


ESI_UPDSTRCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 esi_updstrct   
     Version 1.0

 PURPOSE:
    Creates and outputs a structure for a series of ESI
    spectroscopic images

 CALLING SEQUENCE:
   
  esi_updstrct, struct, LIST=list, MKDIR=mkdir, 
               NOFILE=nofile, NOLIST=nolist

 INPUTS:

 RETURNS:

 OUTPUTS:
   struct     -  Creates an IDL structure for direct images 
         -  ASCII file summarizing the structure

 OPTIONAL KEYWORDS:
   LIST       - Image list
   MKDIR      - Make directories

 OPTIONAL OUTPUTS:

 COMMENTS:

 EXAMPLES:
   esi_updstrct, nght1_strct, /MKDIR


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   01-Aug-2002 Written by JXP

(See ESI/pro/General//esi_updstrct.pro)


ESI_WRSTRCT

[Previous Routine] [List of Routines]
 NAME:
 esi_wrstrct   
    Version 1.1

 PURPOSE:
    Write the esi structure to a FITS file and write an ASCII summary

 CALLING SEQUENCE:
   
  esi_wrstrct, esi, /ANONLY, OUTFIL=, FITS=

 INPUTS:
   esi   - An ESI structure

 RETURNS:

 OUTPUTS:

 OPTIONAL KEYWORDS:
   ANONLY - Only print files with flg_anly NE 0   

 OPTIONAL OUTPUTS:
   OUTFIL= - Output file (default: esi.list)
   FITS=   - Name of fits output file

 COMMENTS:

 EXAMPLES:
   esi_wrstrct, esi, FITS='esi_13oct02.fits'


 PROCEDURES/FUNCTIONS CALLED:

 REVISION HISTORY:
   13-Jul-2002 Written by JXP
   29-Jan-2003  Polished (JXP)

(See ESI/pro/General//esi_wrstrct.pro)