We present a convolution-based algorithm for finding cosmic rays in single
well-sampled astronomical images. The spatial filter used is the point spread
function (approximated by a Gaussian) minus a scaled delta function, and cosmic
rays are identified by thresholding the filtered image. This filter searches
for features with significant power at spatial frequencies too high for
legitimate objects. Noise properties of the filtered image are readily
calculated, which allows us to compute the probability of rejecting a pixel not
contaminated by a cosmic ray (the false alarm probability). We demonstrate that
the false alarm probability for a pixel containing object flux will never
exceed the corresponding probability for a blank sky pixel, provided we choose
the convolution kernel appropriately. This allows confident rejection of cosmic
rays superposed on real objects. Identification of multiple-pixel cosmic ray
hits can be enhanced by running the algorithm iteratively, replacing flagged
pixels with the background level at each iteration.Comment: Accepted for publication in PASP (May 2000 issue). An iraf script
implementing the algorithm is available from the author, or from
http://sol.stsci.edu/~rhoads/ . 16 pages including 3 figures. Uses AASTeX
aaspp4 styl