saltcrclean – Clean multiple CCD extensions for cosmic rays
saltcrclean images outimages outpref (crtype) (thresh) (mbox) (flux_ratio) (bbox) (bthresh) (gain) (rdnoise) (fthresh) (bfactor) (gbox) (maxiter) (multithread) (clobber) (logfile) (verbose)
(bthresh)
Real. Sigma-clipping threshhold for the determination of the background statistics. Used in the fast and median types of cleaning.
SALTCRCLEAN is a task capable of cleaning cosmic rays form single or multi-extension fits data. The task gives users a choice of three different methods of cleaning cosmic rays that provide different levels of performance. The three choices the user has are between fast, median and edge cosmic ray detection.
Fast cosmic ray detection performs very fast identification of cosmic rays in a CCD image. The algorithm will calculate the sigma-clipped background statistics, where all pixels above bthresh are ignored from the calculations. Next, it will detect all pixels above thresh times the background deviation. These pixels will only be identified as cosmic rays if: (1) They are the peak pixel inside the window size of mbox, and (2) if the ratio of the median flux of all the pixels within the window of size mbox to the flux of the identified pixel is less than flux_ratio. Pixels identified as cosmic rays will be replaced with the median value of all of the neighbors within the window specified by mbox. The process will repeat for maxiter. If the grow parameter is set, it will identify all the pixels around an identified cosmic ray and will then replace all of the cosmic rays identified with the median of their neighbors.
Median cosmic ray detection detects cosmic rays through median smoothing the image. The first thing the algorithm does is measure the local background statistics for each pixel. Within a window of bbox size, the background statistics are calculated for each pixel. Then the image is median smoothed with a bin size given by mbox. The median smoothed image is subtracted from the original image, and any pixel thresh times greater than its local background deviation is flagged as a cosmic ray. If gbox > 0, cosmic rays above gthresh will be identified if they are neighboring an already identified cosmic ray. The process will repeat for the number of iterations set by the maxiter parameter.
Edge cosmic ray detection uses a Laplacian filter to detect cosmic rays in an image. This algorithm uses the process outlines in van Dokkem (2001). The first step is that the image is sub-pixel sampled. Then the image is convolved with a Laplacian filter and then returned to its original pixel sampling. A noise image is created by median smoothing the image and applying a realistic estimate for the gain and rdnoise. Cosmic rays are then identified from a signal to noise image after extended sources have been removed. Finally, compact sources are removed by setting the fthresh parameter. Once complete, additional cosmic rays can be found by setting gbox>0. The whole process will iterate until maxiter or until no more cosmic rays are removed.
To clean a sequence of images:
--> saltcrclean images='/Volumes/data1/bxpP*.fits' outimages=''
outpref='/Volumes/data2/m'
clobber='yes' logfile='salt.log' verbose='yes'
For a fast linux machine with a 2.8 Ghz processor and 2 Gb of RAM, one 1043x1024 FITS image can be processed with the following times: fast (4 sec), median (120 sec), and edge (45 sec). For this test, the parameters for SALTCRCLEAN were thresh=5, gbox=3, and maxiter=3 for all of the different methods.
iraf.noao.imred.crutil.cosmicrays iraf.noao.imred.crutil.crmedian