Brighter-fatter effect correction-kernel calculation task.
A command line task for calculating the brighter-fatter correction
kernel from pairs of flat-field images (with the same exposure length).
The following operations are performed:
- The configurable isr task is called, which unpersists and assembles the
raw images, and performs the selected instrument signature removal tasks.
For the purpose of brighter-fatter coefficient calculation is it
essential that certain components of isr are *not* performed, and
recommended that certain others are. The task checks the selected isr
configuration before it is run, and if forbidden components have been
selected task will raise, and if recommended ones have not been selected,
warnings are logged.
- The gain of the each amplifier in the detector is calculated using
the photon transfer curve (PTC) method and used to correct the images
so that all calculations are done in units of electrons, and so that the
level across amplifier boundaries is continuous.
Outliers in the PTC are iteratively rejected
before fitting, with the nSigma rejection level set by
config.nSigmaClipRegression. Individual pixels are ignored in the input
images the image based on config.nSigmaClipGainCalc.
- Each image is then cross-correlated with the one it's paired with
(with the pairing defined by the --visit-pairs command line argument),
which is done either the whole-image to whole-image,
or amplifier-by-amplifier, depending on config.level.
- Once the cross-correlations have been calculated for each visit pair,
these are used to generate the correction kernel.
The maximum lag used, in pixels, and hence the size of the half-size
of the kernel generated, is given by config.maxLag,
i.e. a value of 10 will result in a kernel of size 2n-1 = 19x19 pixels.
Outlier values in these cross-correlations are rejected by using a
pixel-wise sigma-clipped thresholding to each cross-correlation in
the visit-pairs-length stack of cross-correlations.
The number of sigma clipped to is set by config.nSigmaClipKernelGen.
- Once DM-15277 has been completed, a method will exist to calculate the
empirical correction factor, config.biasCorr.
TODO: DM-15277 update this part of the docstring once the ticket is done.
Definition at line 323 of file makeBrighterFatterKernel.py.
def lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.estimateGains |
( |
|
self, |
|
|
|
dataRef, |
|
|
|
visitPairs |
|
) |
| |
Estimate the amplifier gains using the specified visits.
Given a dataRef and list of flats of varying intensity,
calculate the gain for each amplifier in the detector
using the photon transfer curve (PTC) method.
The config.fixPtcThroughOrigin option determines whether the iterative
fitting is forced to go through the origin or not.
This defaults to True, fitting var=1/gain * mean.
If set to False then var=1/g * mean + const is fitted.
This is really a photo transfer curve (PTC) gain measurement task.
See DM-14063 for results from of a comparison between
this task's numbers and the gain values in the HSC camera model,
and those measured by the PTC task in eotest.
Parameters
----------
dataRef : `lsst.daf.persistence.butler.Butler.dataRef`
dataRef for the detector for the flats to be used
visitPairs : `list` of `tuple`
List of visit-pairs to use, as [(v1,v2), (v3,v4)...]
Returns
-------
gains : `lsst.cp.pipe.makeBrighterFatterKernel.BrighterFatterGain`
Object holding the per-amplifier gains, essentially a
dict of the as-calculated amplifier gain values, keyed by amp name
nominalGains : `dict` [`str`, `float`]
Dict of the amplifier gains, as reported by the `detector` object,
keyed by amplifier name
Definition at line 892 of file makeBrighterFatterKernel.py.
def lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.generateKernel |
( |
|
self, |
|
|
|
corrs, |
|
|
|
means, |
|
|
|
objId, |
|
|
|
rejectLevel = None |
|
) |
| |
Generate the full kernel from a list of cross-correlations and means.
Taking a list of quarter-image, gain-corrected cross-correlations,
do a pixel-wise sigma-clipped mean of each,
and tile into the full-sized kernel image.
Each corr in corrs is one quarter of the full cross-correlation,
and has been gain-corrected. Each mean in means is a tuple of the means
of the two individual images, corresponding to that corr.
Parameters:
-----------
corrs : `list` of `numpy.ndarray`, (Ny, Nx)
A list of the quarter-image cross-correlations
means : `list` of `tuples` of `floats`
The means of the input images for each corr in corrs
rejectLevel : `float`, optional
This is essentially is a sanity check parameter.
If this condition is violated there is something unexpected
going on in the image, and it is discarded from the stack before
the clipped-mean is calculated.
If not provided then config.xcorrCheckRejectLevel is used
Returns:
--------
kernel : `numpy.ndarray`, (Ny, Nx)
The output kernel
Definition at line 1263 of file makeBrighterFatterKernel.py.