Skip to content

Commit

Permalink
Update docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Aug 31, 2020
1 parent 38ee22e commit 77c9443
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
32 changes: 31 additions & 1 deletion python/lsst/cp/pipe/linearity.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ def run(self, inputPtc, camera=None, inputDims=None):
Final linearizer calibration.
``outputProvenance`` : `lsst.ip.isr.IsrProvenance`
Provenance data for the new calibration.
Notes
-----
This task currently fits only polynomial-defined corrections,
where the correction coefficients are defined such that:
corrImage = uncorrImage + sum_i c_i uncorrImage^(2 + i)
These `c_i` are defined in terms of the direct polynomial fit:
meanVector ~ P(x=timeVector) = sum_j k_j x^j
such that c_(j-2) = -k_j/(k_1^j) in units of DN^(1-j) (c.f.,
Eq. 37 of 2003.05978). The `config.polynomialOrder` defines
the maximum order of x^j to fit. As k_0 and k_1 are
degenerate with bias level and gain, they are not included in
the non-linearity correction.
"""
if camera:
detector = camera[inputDims['detector']]
Expand Down Expand Up @@ -206,7 +220,23 @@ def run(self, inputPtc, camera=None, inputDims=None):
)

def debugFit(self, stepname, timeVector, meanVector, linearizer, ampName):
"""
"""Debug method for linearity fitting.
Parameters
----------
stepname : `str`
A label to use to check if we care to debug at a given
line of code.
timeVector : `numpy.array`
The values to use as the independent variable in the
linearity fit.
meanVector : `numpy.array`
The values to use as the dependent variable in the
linearity fit.
linearizer : `lsst.ip.isr.Linearizer`
The linearity correction to compare.
ampName : `str`
Amplifier name to lookup linearity correction values.
"""
frame = getDebugFrame(self._display, stepname)
if frame:
Expand Down
16 changes: 0 additions & 16 deletions python/lsst/cp/pipe/ptc.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,22 +167,6 @@ class MeasurePhotonTransferCurveTaskConfig(pexConfig.Config):
)


# @dataclass
# class LinearityResidualsAndLinearizersDataset:
# """A simple class to hold the output from the
# `calculateLinearityResidualAndLinearizers` function.
# """
# # Normalized coefficients for polynomial NL correction
# polynomialLinearizerCoefficients: list
# # Normalized coefficient for quadratic polynomial NL correction (c0)
# quadraticPolynomialLinearizerCoefficient: float
# # LUT array row for the amplifier at hand
# linearizerTableRow: list
# meanSignalVsTimePolyFitPars: list
# meanSignalVsTimePolyFitParsErr: list
# meanSignalVsTimePolyFitReducedChiSq: float


class PhotonTransferCurveDataset:
"""A simple class to hold the output data from the PTC task.
Expand Down

0 comments on commit 77c9443

Please sign in to comment.