Fringing¶
The major causes for fringing are the night sky emission lines (mainly OH transition) in the upper atmosphere. If monochromatic lines are reflected within the CCD they interfere producing a fringe-pattern (usually variable over night). Some instruments show considerable fringing in certain wavebands like the z-band. To correct for the latter a master fringe image has to be created and subtracted before doing photometric measurements.
In PyHDRL this is hdrl.func.Fringe. The class does not require
parameters for initialization.
Master fringe computation¶
The algorithm consists of two main steps: (i) using a Gaussian mixture
model it estimates the background (scalar) and the fringe
scaling-factor (amplitude) of each image. The background is then
subtracted and the amplitude is used to multiplicatively normalize the
background-subtracted image to the same scale. (ii) The resulting
images are then collapsed into a master-fringe image. The collapsing
can be done with all methods currently implemented in
hdrl.func.Collapse.
Masks that can be passed:
ilist_obj: acpl.core.ImageList, one mask per input fringe image flagging the astronomical objects, orNoneif unused. Each step takes this mask into account. The images should have a value of 0 if a pixel does not belong to an object and unity otherwise.stat_mask: an optionalcpl.core.Maskused to exclude image regions with weak fringes, orNoneif unused. This mask is only taken into account when computing the scaling factors, not for the final collapsing.
compute() takes an hdrl.core.ImageList of fringe images and a
hdrl.func.Collapse instance. It works on the passed HDRL imagelist
in order to save memory, thus modifying this imagelist. The scaling
factor derived and used in this function is considered to be
noiseless.
After compute(), results are properties of the Fringe object:
master (hdrl.core.Image), contrib_map (cpl.core.Image)
and qctable (cpl.core.Table).
fringe = hdrl.func.Fringe()
collapse = hdrl.func.Collapse.Mean()
fringe.compute(ilist_fringe, collapse_params=collapse)
master_fringe = fringe.master
contrib_map = fringe.contrib_map
qctable = fringe.qctable
Fringe correction¶
correct() applies fringe correction by subtracting a scaled
version of the master fringe pattern. The scaling is determined by
fitting the fringe amplitude for each image. The correction is applied
in-place to the images in ilist_fringe (an hdrl.core.ImageList).
ilist_obj and stat_mask have the same types as for
compute(), and may be None. masterfringe is an
hdrl.core.Image, or None to use the master from the last
compute().
It returns a hdrl.func.FringeCorrectResult whose qctable
attribute is a cpl.core.Table with background levels and fringe
amplitudes for each image.
result = fringe.correct(ilist_fringe, ilist_obj, stat_mask, masterfringe)
qctable = result.qctable