Identify cosmic rays through the lacosmic technique. The lacosmic technique identifies cosmic rays by identifying pixels based on a variation of the Laplacian edge detection. The algorithm is an implementation of the code describe in van Dokkum (2001) [R1].
Parameters: | ccd: `~ccdproc.CCDData` or `numpy.ndarray`
error_image : numpy.ndarray
thresh : float
fthresh : float
gthresh : float
b_factor : int
mbox : int
min_limit: float
gbox : int
rbox : int
f_conv: `numpy.ndarray`, optional
{log} |
---|---|
Returns: |
nccd : ndarray
|
Notes
Implementation of the cosmic ray identification L.A.Cosmic: http://www.astro.yale.edu/dokkum/lacosmic/
References
[R1] | (1, 2) van Dokkum, P; 2001, “Cosmic-Ray Rejection by Laplacian Edge Detection”. The Publications of the Astronomical Society of the Pacific, Volume 113, Issue 789, pp. 1420-1427. doi: 10.1086/323894 |
Examples
Given an numpy.ndarray object, the syntax for running cosmicrar_lacosmic would be:
>>> newdata, mask = cosmicray_lacosmic(data, error_image=error_image,
thresh=5, mbox=11, rbox=11,
gbox=5)
where the error is an array that is the same shape as data but includes the pixel error. This would return a data array, newdata, with the bad pixels replaced by the local median from a box of 11 pixels; and it would return a mask indicating the bad pixels.
Given an CCDData object with an uncertainty frame, the syntax for running cosmicrar_lacosmic would be:
>>> newccd = cosmicray_lacosmic(ccd, thresh=5, mbox=11, rbox=11, gbox=5)
The newccd object will have bad pixels in its data array replace and the mask of the object will be created if it did not previously exist or be updated with the detected cosmic rays.