
2008.05.14 

  ppSim needs some work to be a bit more realistic.  It currently does
  not do the correct thing for generating flats or shutter
  corrections.  It is only applying them to the background sky model.
  It is not applying them to the stellar flux.  Also, for adding
  sources on top of existing images, it needs to apply the Poisson
  stats to the generated stars and then add the pixel values to the
  input image.  currently, it is placing them directly in the input
  image.



ppSim development work still needed:

* save sources in output files
* load input image

* optionally apply detrend data (bias, dark, etc).  when adding data
  to a loaded image, we only need to inject fake stars.

* examine the range of star fluxes.  (too many are being generated).  
* check the overlap between the real and random star fluxes

* generate stars with / without known exposure correction (ie, stars
  could be generated with known fluxes or know magnitudes)

* generate galaxies (objects with random values for major, minor, theta)
* generate convolved galaxies

* should not have to supply ZP, Seeing, PA, Scale on command line for all ppSim runs
* DVO.CATDIR path://SIMTEST is not being interpolated?
* -D PSASTRO:DVO.CATDIR is not being interpretted?

* fake stars do not have random magnitudes?
* add generated stars to an output file (pmSource list?)
* make star source an option (random / dvo database)
* add the gain to the metadata

ppSimLoop:

  * load catalogs stars (ra, dec, mag, x, y)
  * generate random stars (ra, dec, mag, x, y)
  * loop over chip,cell,readout
  ** generate output images (signal, variance)
  ** add the bias
  ** add the dark
  ** add the sky signal 
  ** add the stars (modified by the flat, shutter)
  ** add the galaxies (modified by the flat, shutter)
  ** add the poisson noise
  ** add the overscan + readnoise
  ** save the stars
  ** save the galaxies

  ** update the concept info
  ** update the header wcs info
  ** write out the image data

