Detect bad-pixels / cosmic-rays on a single image.
Detailed Description
Algorithm to detect bad-pixels and cosmic-rays hits on a single image like e.g. science frames.
This routine determines bad-pixels on a single image via edge detection following the algorithm (LA-Cosmic) describe in van Dokkum, PASP,113,2001,p1420-27. The HDRL implementation does not use use error model as described in the paper but the error image passed to the function. Moreover we do several iterations and replace the detected bad pixels in each iteration by the information of the surrounding pixels.
Detect bad-pixels / cosmic-rays on a single image.
Parameters
ima_in
The input image
params
LaCosmic computation parameters
Returns
Mask where all detected bad-pixels/cosmics-rays are marked as bad or NULL on error
This routine determines bad-pixels on a single image via edge detection following the algorithm (LA-Cosmic) describe in van Dokkum, PASP,113,2001,p1420-27. It was originally developed to detect cosmic ray hits but can also be used in the more general context of detecting bad pixels. The HDRL implementation does not use use error model as described in the paper but the error image passed to the function. Moreover we do several iterations with max_iter defining an upper limit for the number of iterations, i.e. the iteration stops if no new bad pixels are found or max_iter is reached. In each iteration we replace the detected cosmic ray hits by the median of the surroundings 5x5 pixels taking into account the pixel quality information. The input parameter sigma_lim and f_lim refer to and as described in the paper mentioned above. The hdrl parameter passed to this routine is created by hdrl_lacosmic_parameter_create().
Note
Be aware that the implementation only detects positive bad pixels / cosmic ray hits, i.e. no "holes" in the image are detected, but in such a case the pixels surrounding the whole are marked as bad. Holes in the image can be introduced, if e.g. one subtracts a not cosmic-ray-cleaned image from another image.