pro mklist, output, prefix, nelem, start_index=start_index, suffix=suffix

       ; Name:
       ; mklist.pro
       ;
       ; PURPOSE: 
       ; This procedure creates a list of
       ; e.g. filenames with specified prefix, number of elements, and
       ; optional start index and suffix.
       ;
       ; CALLING SEQUENCE:
       ;       mklist, input_data, output_data
       ;
       ; INPUTS:
       ;       input_data    - A 1024x1024 array containing the image data.
       ;       output_data   - A 1024x1024 fltarr for the result
       ;
       ; KEYWORD PARAMETERS:
       ;       fwindow       - The size of the filter window. 
       ;       order         - Filter order, see the SAVGOL help page
       ;       degree        - Filter degree, see the SAVGOL help page
       ;       plot          - Set this =1 to plot the fits
       ;       simple        - Set this =1 to subtract a median reference pixel
       ;                     
       ;       verbose       - Set this =1 for verbose mode.
       ;
       ;
       ; EXAMPLE
       ;        IDL> fits_read, 'theImage.fits', myData, myHeader
       ;        IDL> myNewDate = fltarr(1024, 1024)
       ;	IDL> mklist, myData, myNewData
       ;
       ;
       ; REFERENCE:
       ;
       ;
       ; MODIFICATION HISTORY:
       ;       Written by:
       ;       Modified:    B.J. Rauscher, IDTL, August 4, 2002
       ;                    Initial release
       ;                    B.J. Rauscher, IDTL, August 16, 2002
       ;                    Modified to exclude outtermost reference pixels
       ;                    from statistics. These appear to be anomalously
       ;                    bright.
       ;
       ;-


       ;; Command line defaults
       if (not keyword_set(start_index)) then start_index = 0;
       if (not keyword_set(suffix)) then suffix = '.fits';

       ;; Trap command line errors
       if (n_params() ne 3) then begin
           print, 'Usage: mklist, filename, prefix, nelem [, start_index=start_index, suffix=suffix]'
           stop
       endif

       ;; Open the output file for writing
       openw, unit, output, /get_lun

       ;; Write file names
       for i = start_index, start_index + nelem - 1 do begin
           filename = prefix+strtrim(string(i), 2)+suffix
           printf, unit, filename
       endfor

       ;; Tidy up
       close, unit
       
end
