Preparation
Create a directory where the output should go. Inside that
  directory, make a directory called Raw, place a nights
  worth of data in that directory.
  
Beyond this, everything should be handled by the routines.
A guide on how to use the XIDL Hamilton Spectrograph Data Reduction Pipeline
Create a directory where the output should go. Inside that
  directory, make a directory called Raw, place a nights
  worth of data in that directory.
  
Beyond this, everything should be handled by the routines.
hamspec_pipeline will run the entire set of steps
  listed below.
  /clobber option./usesetup flag. This
    flag will still skip the setup process even with the
    /clobber  flag.
    stretch=value keyword can be used to
    recompute the arc solution but with a stretch. To determine the
    stretch, you will need to compare the one-dimensional arc spectrum
    made from the arc frames with the archival spectrum. The
    instructions are in the discussion
    of how to fix an order
    
    Each of the steps below is listed in the file
hamspec_pipeline.pro. In principle, that code should
produce the final output. However, there are places where our
automation could fail.
  
hamspec_strct,strct Create data structures, for book
  keeping, makes additional directories.
  hamspec_setup Continues data frame classification -
  summary of output in ASCII files. One of the key outputs is a
  grouping of files into setups. Frames with similar deckers, echelle
  tilts, and cross-disperser tilts. This can be changed by exiting the
  ASCII files and rerunning hamspec_setup, the file will
  be read instead of generating new values. 
  
  hamspec_wrstrct Write structure to disk
  hamspec_mkmflat Makes a pixel flat, see for details, this can be skipped
  if you use the archived flat we have made.
  hamspec_mkflats,strct,setup#,'TFLT' This makes a
  trace flat. This is needed to trace out the order locations and
  decide what is going to be extracted. The strct is the
  output of hamspec_strct. The setup# is a
  integer for each observational setup.
  hamspec_edgeflat Finds the slit edges in the trace flat
  hamspec_normflat Normalizes the trace flat
  hamspec_mkarc Makes the final arc image. This
  intelligently combines frames taken with different filters.
  hamspec_fitarc This does an initial fitting of the
  arc frame, order by order. For some orders, there are no good lines,
  and these are skipped. This uses a reference arc taken at a specific
  set of tilts, and cross-correlates that reference with the data. The
  resulting fits are used to identify more lines.
  hamspec_fit2darc Uses previous line
  identifications, but not the resulting fits, to construct a
  two-dimensional model of wavelength as a function of pixel position
  and order number. Currently, this code does not always produce good
  results, we have a method for fixing
  bad orders.
  
  hamspec_tracearc Traces out arc across the
  dispersion direction. This is to map out pixels in an order at a
  constant wavelength.
  
  hamspec_fittrcarc
  hamspec_mkaimg
  hamspec_slitflat Apply above results to flat.
  hamspec_loopobjs Loops through each object
  exposure, processes the frame, finds the object and does the
  extraction.
  
If you observe the same object multiple times, an additional step must be run.
hamspec_combspec which requires the structure, the
setup#, the object id, and optional integer list of images (0,1,2, etc.).