LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, data, weights, line=None) | |
setLineMask (self, line) | |
makeProfile (self, line, fitFlux=True) | |
fit (self, dChi2Tol=0.1, maxIter=100, log=None) | |
Public Attributes | |
data | |
weights | |
mask | |
lineMask | |
lineMaskSize | |
Protected Member Functions | |
_makeMaskedProfile (self, line, fitFlux=True) | |
_lineChi2 (self, line, grad=True) | |
Protected Attributes | |
_ymax | |
_xmax | |
_dtype | |
_rhoMax | |
_xmesh | |
_ymesh | |
_initLine | |
_maskData | |
_maskWeights | |
_mxmesh | |
_mymesh | |
Construct and/or fit a model for a linear streak. This assumes a simple model for a streak, in which the streak follows a straight line in pixels space, with a Moffat-shaped profile. The model is fit to data using a Newton-Raphson style minimization algorithm. The initial guess for the line parameters is assumed to be fairly accurate, so only a narrow band of pixels around the initial line estimate is used in fitting the model, which provides a significant speed-up over using all the data. The class can also be used just to construct a model for the data with a line following the given coordinates. Parameters ---------- data : `np.ndarray` 2d array of data. weights : `np.ndarray` 2d array of weights. line : `Line`, optional Guess for position of line. Data far from line guess is masked out. Defaults to None, in which case only data with `weights` = 0 is masked out.
Definition at line 106 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.__init__ | ( | self, | |
data, | |||
weights, | |||
line = None ) |
Definition at line 130 of file maskStreaks.py.
|
protected |
Construct the chi2 between the data and the model. Parameters ---------- line : `Line` `Line` parameters for which to build model and calculate chi2. grad : `bool`, optional Whether or not to return the gradient and hessian. Returns ------- reducedChi : `float` Reduced chi2 of the model. reducedDChi : `np.ndarray` Derivative of the chi2 with respect to rho, theta, invSigma. reducedHessianChi : `np.ndarray` Hessian of the chi2 with respect to rho, theta, invSigma.
Definition at line 245 of file maskStreaks.py.
|
protected |
Construct the line model in the masked region and calculate its derivatives. Parameters ---------- line : `Line` Parameters of line profile for which to make profile in the masked region. fitFlux : `bool` Fit the amplitude of the line profile to the data. Returns ------- model : `np.ndarray` Model in the masked region. dModel : `np.ndarray` Derivative of the model in the masked region.
Definition at line 167 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.fit | ( | self, | |
dChi2Tol = 0.1, | |||
maxIter = 100, | |||
log = None ) |
Perform Newton-Raphson minimization to find line parameters. This method takes advantage of having known derivative and Hessian of the multivariate function to quickly and efficiently find the minimum. This is more efficient than the scipy implementation of the Newton- Raphson method, which doesn't take advantage of the Hessian matrix. The method here also performs a line search in the direction of the steepest derivative at each iteration, which reduces the number of iterations needed. Parameters ---------- dChi2Tol : `float`, optional Change in Chi2 tolerated for fit convergence. maxIter : `int`, optional Maximum number of fit iterations allowed. The fit should converge in ~10 iterations, depending on the value of dChi2Tol, but this maximum provides a backup. log : `lsst.utils.logging.LsstLogAdapter`, optional Logger to use for reporting more details for fitting failures. Returns ------- outline : `np.ndarray` Coordinates and inverse width of fit line. chi2 : `float` Reduced Chi2 of model fit to data. fitFailure : `bool` Boolean where `False` corresponds to a successful fit.
Definition at line 279 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.makeProfile | ( | self, | |
line, | |||
fitFlux = True ) |
Construct the line profile model. Parameters ---------- line : `Line` Parameters of the line profile to model. fitFlux : `bool`, optional Fit the amplitude of the line profile to the data. Returns ------- finalModel : `np.ndarray` Model for line profile.
Definition at line 225 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.setLineMask | ( | self, | |
line ) |
Set mask around the image region near the line. Parameters ---------- line : `Line` Parameters of line in the image.
Definition at line 144 of file maskStreaks.py.
|
protected |
Definition at line 134 of file maskStreaks.py.
|
protected |
Definition at line 141 of file maskStreaks.py.
|
protected |
Definition at line 162 of file maskStreaks.py.
|
protected |
Definition at line 163 of file maskStreaks.py.
|
protected |
Definition at line 164 of file maskStreaks.py.
|
protected |
Definition at line 165 of file maskStreaks.py.
|
protected |
Definition at line 137 of file maskStreaks.py.
|
protected |
Definition at line 133 of file maskStreaks.py.
|
protected |
Definition at line 138 of file maskStreaks.py.
|
protected |
Definition at line 133 of file maskStreaks.py.
|
protected |
Definition at line 138 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.data |
Definition at line 131 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.lineMask |
Definition at line 157 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.lineMaskSize |
Definition at line 161 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.mask |
Definition at line 139 of file maskStreaks.py.
lsst.meas.algorithms.maskStreaks.LineProfile.weights |
Definition at line 132 of file maskStreaks.py.