NAME:
   addcrs
 PURPOSE:
   Add synthetic cosmic ray strikes to a CCD image.
 DESCRIPTION:
   Using an estimate of mean strikes on the image, an actual strike
   count is created as a Poisson deviate.
   Based on a normal distribution of maximum pixel intensity,
   the strikes are then added to the ccd image array.
   It is possible to save the struck image array as a fits file.
 CATEGORY:
   CCD data processing
 CALLING SEQUENCE:
   addcrs,meancrs,mincount,maxcount,img
 INPUTS:
   meancrs  - Average number of strikes to add per image.
   mincount - lowest DN for cosmic ray strikes
   maxcount - highest DN for cosmic ray strikes
   seed     - seed value for random number generation
   img      - 2-D image array to be modified
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
   OVERSCAN - number of columns in overscan to skip, ie, if img is
                 m X n,  the region from  [0:m-overscan-1, 0:n-1] 
                 is where the cosmic rays will be added.
   FITSFN   - full path name to write FITS file of the modified img.
   DEBUG    - Flag, if set, turn on debug output.
 OUTPUTS:
   img         2-D image array to be modified
 KEYWORD OUTPUT PARAMETERS:
   CRSOUT -  Output, number of cosmic rays added to the image.
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
   2006/07/02,  Written, Peter L. Collins, Lowell Observatory  
                 (as addcrstrikes,pro,  for avgclip testing)
   2006/07/10,   PLC, extend pixel size of cr strike for visibility in itool.
                  (keyword PIXEXT)
   2006/07/11,   changed name and dns values chosen by uniform draw.
   2006/07/13,   PLC, add keyword CRSOUT.
   2006/07/14, MWB, final cleanup and addition to library