ElectrostaticFit

class lsst.cp.pipe.utils.ElectrostaticFit(initialParams, fitMethod, aMatrix, aMatrixSigma, fitRange, doFitNormalizationOffset, nImageChargePairs)

Bases: object

Class to handle the electrostatic fit of area coefficients.

This class manages the fitting of electrostatic model parameters to measured area change coefficients. The actual electrostatic calculations are performed by the ElectrostaticCcdGeom class. The fit is performed using the lmfit Minimizer, and the model includes normalization parameters (alpha, beta) as well as physical CCD parameters.

Attributes:
fitRangeint

Range of pixels to fit.

inputRangeint

Range of input data.

doFitNormalizationOffsetbool

Whether to fit an offset parameter.

nImageChargePairsint

Number of image charge pairs used in the electrostatic calculation.

fitMethodstr

Minimization method used by lmfit.

aMatrixnp.ndarray

Measured area change matrix.

aMatrixSigmanp.ndarray

Uncertainty matrix for area changes.

sqrtWeightsnp.ndarray

Weights for fitting, inverse of aMatrixSigma.

paramslmfit.Parameters

Fit parameters.

Methods Summary

computePixelDistortions([conversionWeights])

Compute pixel distortions using a probability distribution of conversion depths.

computeWeightedResidual([params])

fit()

getParamsDict()

Return a copy of the free parameters vector as a dictionary.

model(params)

normalizeModel(m)

Compute optimal normalization and offset for the model.

rawModel(params)

Methods Documentation

computePixelDistortions(conversionWeights=None)

Compute pixel distortions using a probability distribution of conversion depths.

If provided, conversionWeights is expected to be a tuple of (depth, probability). The routine computes the model corresponding to this probability distribution. If conversionWeights is not provided, then [(0, 1.)] is used as the distribution.

Parameters:
conversionWeightstuple of (np.ndarray, np.ndarray), optional

Tuple containing depths and their associated probabilities.

Returns:
BoundaryShifts

The computed boundary shifts for the pixel.

computeWeightedResidual(params=None)
fit()
getParamsDict()

Return a copy of the free parameters vector as a dictionary.

model(params)
normalizeModel(m)

Compute optimal normalization and offset for the model.

The overall normalization is a linear parameter. This method computes the optimal value given the other parameters.

rawModel(params)