lsst.cp.pipe  21.0.0-4-g42917e2+f94c4b0f7d
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask Class Reference
Inheritance diagram for lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def validateIsrConfig (self)
 
def runDataRef (self, dataRef, visitPairs)
 
def estimateGains (self, dataRef, visitPairs)
 
def generateKernel (self, corrs, means, objId, rejectLevel=None)
 
def successiveOverRelax (self, source, maxIter=None, eLevel=None)
 

Public Attributes

 debug
 
 disp1
 
 disp2
 

Static Public Attributes

 RunnerClass = PairedVisitListTaskRunner
 
 ConfigClass = MakeBrighterFatterKernelTaskConfig
 

Detailed Description

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 329 of file makeBrighterFatterKernel.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.__init__ (   self,
args,
**  kwargs 
)

Definition at line 379 of file makeBrighterFatterKernel.py.

Member Function Documentation

◆ estimateGains()

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 898 of file makeBrighterFatterKernel.py.

◆ generateKernel()

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 1269 of file makeBrighterFatterKernel.py.

◆ runDataRef()

def lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.runDataRef (   self,
  dataRef,
  visitPairs 
)
Run the brighter-fatter measurement task.

For a dataRef (which is each detector here),
and given a list of visit pairs, calculate the
brighter-fatter kernel for the detector.

Parameters
----------
dataRef : `list` of `lsst.daf.persistence.ButlerDataRef`
    dataRef for the detector for the visits to be fit.
visitPairs : `iterable` of `tuple` of `int`
    Pairs of visit numbers to be processed together

Definition at line 459 of file makeBrighterFatterKernel.py.

◆ successiveOverRelax()

def lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.successiveOverRelax (   self,
  source,
  maxIter = None,
  eLevel = None 
)
An implementation of the successive over relaxation (SOR) method.

A numerical method for solving a system of linear equations
with faster convergence than the Gauss-Seidel method.

Parameters:
-----------
source : `numpy.ndarray`
    The input array.
maxIter : `int`, optional
    Maximum number of iterations to attempt before aborting.
eLevel : `float`, optional
    The target error level at which we deem convergence to have
occurred.

Returns:
--------
output : `numpy.ndarray`
    The solution.

Definition at line 1406 of file makeBrighterFatterKernel.py.

◆ validateIsrConfig()

def lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.validateIsrConfig (   self)
Check that appropriate ISR settings are being used
for brighter-fatter kernel calculation.

Definition at line 421 of file makeBrighterFatterKernel.py.

Member Data Documentation

◆ ConfigClass

lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.ConfigClass = MakeBrighterFatterKernelTaskConfig
static

Definition at line 376 of file makeBrighterFatterKernel.py.

◆ debug

lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.debug

Definition at line 383 of file makeBrighterFatterKernel.py.

◆ disp1

lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.disp1

Definition at line 394 of file makeBrighterFatterKernel.py.

◆ disp2

lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.disp2

Definition at line 395 of file makeBrighterFatterKernel.py.

◆ RunnerClass

lsst.cp.pipe.makeBrighterFatterKernel.MakeBrighterFatterKernelTask.RunnerClass = PairedVisitListTaskRunner
static

Definition at line 375 of file makeBrighterFatterKernel.py.


The documentation for this class was generated from the following file: