API/Reference
LACosmic.lacosmic
— Functionlacosmic(data::AbstractMatrix;
noise=nothing,
gain=1,
background=0,
readnoise=0,
mask=falses(size(data)),
sigma_clip=4.5,
contrast=5,
neighbor_thresh=0.3,
maxiter=4,
saturation_level=2^16,
block_size=2)
Laplacian cosmic ray detection (LACosmic). This algorithm implements the algorithm presented in lacosmicx. The return values are the cleaned image and the bad pixel mask. The image cleaning is done via median interpolation.
Parameters
noise
is the pre-determined estimate of the data noise (square root of variance), if anygain
is the image gain in electrons per data numberbackground
is pre-determined image background, if anyreadnoise
is the read noise of the image in electronsmask
is an input bad pixel mask, wheretrue
represents a bad pixelsigma_clip
is the Laplacian signal-to-noise ratio for flagging bad pixelscontrast
is the minimum contrast required to flag a bad pixel in the ratio of the Laplacian image to the fine-structure imageneighbor_thresh
is the fractional detection limit for cosmic rays surrounding other cosmic rays. Should be a number between 0 and 1.maxiter
is the maximum number of iterations used for detecting bad pixelssaturation_level
is the saturation value in electronsblock_size
is the subsampling factor for the Laplacian filter image.
Examples
julia> image = 100 .* randn(1001, 1001) .+ 1000;
julia> clean_image, mask = lacosmic(image, gain=4);
References
van Dokkum, P.G. (2001) - "Cosmic-Ray Rejection by Laplacian Edge Detection"