Skip to content
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-34912: Include pixel clipping and masks in "getGainFromFlatPair" as in "measureMeanVarCov" of "cpPtcSolve" #131

Merged
merged 4 commits into from May 26, 2022

Conversation

plazas
Copy link
Contributor

@plazas plazas commented May 24, 2022

No description provided.

(e.g, an amplifier).
imageProperties : `dict`
Dictionary with masked image regions, mask planes, statistic
control objects, and clipped means.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should list the expected keys and their types.

-------
resultsDict : `dict`
Dictionary with masked image regions, mask planes, statistic
control objects, and clipped means.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, expected keys/etc.

im2Area = afwMath.binImage(im2Area, self.config.binSize)

im1MaskVal = exposure1.getMask().getPlaneBitMask(self.config.maskNameList)
im1StatsCtrl = afwMath.StatisticsControl(self.config.nSigmaClipPtc,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need two stat control objects that are essentially the same? Is the concern that the mask planes will be in a different order? These are also returned, but I'm not sure I see them used elsewhere. Are they used in code that hasn't changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a guarantee that exposure1.getMask().getPlaneBitMask(self.config.maskNameList) will be equal to exposure2.getMask().getPlaneBitMask(self.config.maskNameList) ? Would that object be the same to be used in ratioImMaskVal = ratioIm.getMask().getPlaneBitMask(self.config.maskNameList) of getGainFromFlatPair and in diffImMaskVal = diffIm.getMask().getPlaneBitMask(self.config.maskNameList) of measureMeanVarCov?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for not being used after being returned, I think you are correct, thanks!

const = np.mean((im1Area - im2Area)**2 / (im1Area + im2Area))
gain = 1. / const
(im1Area, im1MaskVal, im1StatsCtrl, im2Area,
im2MaskVal, im2StatsCtrl, mu1, mu2) = imageProperties.values()
Copy link
Contributor

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 have this be a dict if it's only used as imageProperties.values()? I think the ordering is guaranteed to be consistent, but a tuple would do the same thing.
If you expect to want to access these by key in the future, then ignore this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it to a tuple. I wasn't sure if a dictionary would be more compact.

@plazas plazas merged commit 93f34df into main May 26, 2022
@plazas plazas deleted the tickets/DM-34912 branch May 26, 2022 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants