imProc.dark - EranOfek/AstroPack GitHub Wiki
Description
The imProc.dark package contains basic functions to identify dark and bias images, generate master bias images, and subtract science images and the master bias. All operations including the generation and propagation of bit mask images associated with the dark/bias images.
An introduction to bias and flat calibration is available here. Additional related packages and classes are: imProc.flat, CalibImages, and tools in the pipeline package.
Functions
The functions in this package typically get AstroImage objects as input.
- isBias - Check and validate that a set of images in an AstroImage object are bias images.
- isDark - Check and validate that a set of images in an AstroImage object are dark images.
- bias - Generate a super bias image from a set of bias images.
- debias - Subtract bias (and construct if needed) from a list of images.
- overscan - Create overscan images and optionally subtract from images.
Utility functions:
- compare2template - Compare AstroImage to a template and variance and flag image.
- identifyFlaringPixels - Identity flaring pixels in a cube of images.
- identifySimilarImages - Search for successive images with a fraction of identical pixel values.
imProc.dark.isBias
The following example will search for bias images bias on the IMTYPE header keyword. For more details and options see the function help.
A=AstroImage('LAST.*_dark.fits');
F=imProc.image.isBias(A);
imProc.dark.bias
To prepare a master bias image:
A=AstroImage('LAST.*_dark.fits')
Bias = imProc.dark.bias(A)
imProc.dark.debias
The debias function can identify bias images, construct a master bias image, and subtract it from all science images (i.e., non-bias images).
% Read FITS images into an AstroImage:
AI = AstroImage('LAST.2.1.2_20200821.015445.457_clear_0_science.fits');
AB = imProc.dark.debias(AI);
Alternatively, if a Bias image exists:
% Given an AstroImage object (AI) with multiple science images,
% and an AstroImage object (Bias) containing the master bias image:
AB = imProc.dark.debias(AI, Bias);
imProc.dark.overscan
To estimate the overscan bias level and subtract it from the images:
% Here the input AI is an AstroImage object containing the science images:
[Result, OverScanAI] = imProc.dark.overscan(AI, 'OverScan',[1 10 1 9600])
% or
[Result, OverScanAI] = imProc.dark.overscan(AI, 'OverScan',[6379 6388 1 9600])
% or
[Result, OverScanAI] = imProc.dark.overscan(AI, 'OverScan',[6379 6388 1 9600],'Method','medmedfilt')
% to read the overscan region from the header keyword "OVERSCAN" use the default:
[Result, OverScanAI] = imProc.dark.overscan(AI, 'Method','medmedfilt')
% or
[Result, OverScanAI] = imProc.dark.overscan(AI, 'OverScan','OVERS')