New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-31896: Clarify PTC code #112
Conversation
c565377
to
8f5cf3c
Compare
dd8dded
to
c3e3858
Compare
c3e3858
to
0eb934c
Compare
eb88feb
to
2485b0a
Compare
Change fitting functions names in tests
Fix typos
Fix bugs Clarify docstrings
Fix typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping we can still simplify some more by removing the fft/direct choice, and keeping functions that are only called by one task as task methods.
The number of partially-filled | ||
`~lsst.ip.isr.PhotonTransferCurveDataset` objects will be less | ||
than the number of input exposures because the task combines | ||
input flats in pairs. However, it is required at this mioment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
before this task), produced a list of | ||
`~lsst.ip.isr.PhotonTransferCurveDataset` objects. Each dataset | ||
contains the mean signal and covariances of the | ||
difference image of to flat-field images taken at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "of the flat-field images"?
@@ -35,11 +35,9 @@ | |||
from lsst.utils.timer import timeMethod | |||
|
|||
from lsst.cp.pipe.utils import (funcAstier, funcPolynomial, NonexistentDatasetTaskDataIdContainer, | |||
calculateWeightedReducedChi2) | |||
calculateWeightedReducedChi2, getFitDataFromCovariances) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we drop this file entirely, as gen2 is now deprecated?
return cov, var, muVals | ||
|
||
|
||
def symmetrize(inputArray): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplicates/is duplicated by BrighterFatterKernelSolveTask._tileArray(). I've added DM-33353 to unify these methods.
python/lsst/cp/pipe/utils.py
Outdated
return mu, covariance, covarianceModel, weights, maskFromWeights | ||
|
||
|
||
def makeCovArray(inputTuple, maxRangeFromTuple=8): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ever called outside of PhotonTransferCurveExtractTask? I have the same question with computeCovDirect
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's only called by the extract class, so I moved it there.
python/lsst/cp/pipe/utils.py
Outdated
return tupleVec | ||
|
||
|
||
def computeCovDirect(diffImage, weightImage, maxRange): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to keep both the direct and FFT convolutions? If they give the same result, we should just implement one. I see we use the FFT by default, so maybe keeping that one? However, we tend to use lags of 8, which suggests the direct method should be faster (it's also simpler).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the FFT version.
c = params[lenParams:2*lenParams].reshape((matrixSide, matrixSide)) | ||
noise = params[2*lenParams:3*lenParams].reshape((matrixSide, matrixSide)) | ||
gain = params[-1] | ||
if key == 'fullModel': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this just be fitResults[key]['a'] = a
, and avoid this if/else?
5c4077f
to
4529b55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few minor typos are all I could see.
if (muDiff <= minMeanSignalDict[ampName]) or (muDiff >= maxMeanSignalDict[ampName]): | ||
expIdMask = False | ||
|
||
if covAstier is not None: | ||
# Turn the tuples with teh measured information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
c = CovFastFourierTransform(diffIm.image.array, w, fftShape, maxRangeCov) | ||
covDiffAstier = c.reportCovFastFourierTransform(maxRangeCov) | ||
|
||
# Calculate covariances via FFT (default). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the default anymore, as we only have the one option.
4529b55
to
14b38e8
Compare
No description provided.