How to Use ghostbgone
=====================
 J.C. Martin, University of Minnesota (30 Nov 2004)

Notes on Linking & Compiling:
  This code requires the standard CFITSIO library to run.  It was originally
compiled with version 2.0 of that library.  This library can be obtained
for various platforms from:
 http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html

Getting Started:
  Ghostbgone is able to interactively model and remove the ghost image
  of a bright Balmer H-alpha emission feature from STIS CCD
  observations mad with 6768 setting of the G750M grating.  This
  algorithm may or may not be useful for removing other ghosts.  We
  make no guarantees there.  For details about the theory and caveats
  associated with the algorithm used by ghostbgone see the Eta Carinae
  Treasury Project Technical Memo #10:
   http://etacar.umn.edu/treasury/techmemos/
  A copy of this memo as a PDF has been included in this distribution.

  To run ghostbgone in fully automatic mode simply invoke it in the
  following manner:
    ghostbgone input.fits -o output.fits
  Executed with that command, ghostbgone will attempt to locate and
  find the parameters of the H-alpha ghost without any interaction
  from the user.  This works most of the time.  However, we suggest
  that you should fine tune the parameters of the ghost interactively
  in order to achieve optimal ghost removal.  An initial run in fully
  automatic mode will output a set of parameters which you can
  refine.  For example:

    > ghostbgone /archive/new_release/c800-007.fits.gz -otest.fits
    Ghost:
      Center = (418.374,455.472)
      Width: (30.9144,13.2846)
      Peak = 1.749629e-14
    
  In the event that ghostbgone is unable to locate the ghost at all
  you can give it an initial guess as to the center (using the -c
  command), width on the X and Y axes (using the -s command), or the
  peak value (using the -p command).  If you wish to then usurp
  control from the fitting algorithms built into ghostbgone and have
  it explicitly use the parameters which you provide, you can invoke
  the -f command.  We suggest that you iterate the procedure until the
  ghost has been subtracted from the output file to your satisfaction.

  There are also two debugging options in ghostbgone:  
    -g turns on general debugging mode which provides more output from
       the program.  
    -m forces the output file to contain the model of the ghost itself
       rather than the original image with the model subtracted.

  Happy removing!