ElectrostaticFit¶
- class lsst.cp.pipe.utils.ElectrostaticFit(initialParams, fitMethod, aMatrix, aMatrixSigma, fitRange, doFitNormalizationOffset, nImageChargePairs)¶
Bases:
objectClass 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([max_nfev, epsfcn, ftol, xtol, gtol])Do the fit.
Return a copy of the free parameters vector as a dictionary.
model(params)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(max_nfev=20000, epsfcn=1e-08, ftol=1e-08, xtol=1e-08, gtol=0.0)¶
Do the fit.
- Parameters:
- max_nfev
float, optional Max number of function evaluations.
- epsfcn
float, optional A variable used in determining a suitable step length for the forward-difference approximation of the Jacobian.
- ftol
float, optional Relative error desired in the sum of squares.
- xtol
float, optional Relative error desired in the approximate solution.
- gtol
float, optional Orthogonality desired between the function vector and the columns of the Jacobian.
- max_nfev
- 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)¶