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-16347: Fix modelWeights bugs. #234

Merged
merged 2 commits into from Nov 10, 2018
Merged

DM-16347: Fix modelWeights bugs. #234

merged 2 commits into from Nov 10, 2018

Conversation

isullivan
Copy link
Contributor

Some cases errored with mis-matched bounding boxes, and assembling a coadd returned early if the new option useModelWeights was turned off.

weights = np.zeros_like(maskedImage.image.array)
bboxGrow = afwGeom.Box2I(bbox)
bboxGrow.grow(self.bufferSize)
bboxGrow.clip(dcrModels.bbox)
Copy link
Contributor

@laurenam laurenam Nov 9, 2018

Choose a reason for hiding this comment

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

It took some back-and-forthing to figure out the need for and significance of bboxGrow. For the latter, some documentation or comment would be nice. For the former, I see that this weight image is used in the context of a similarly bboxGrown image in the dcrAssembleSubregion() function at L521. Given that these are required to be the same, it is a bit uncomfortable that they are computed independently in each function. Might it be useful to set bboxGrow in run itself and pass this directly into both functions (calculateModelWeights() and dcrAssembleSubregion(), and I do realize the latter will also need the subs for the dcrModels.assign call at L528, but it still may be worthwhile for clarity)? That way the place to document it would naturally be part of the Parameters lists.

Regardless, you also need to update the docs for this function. It would also be nice to have a bit more info on what the weights here actually represent (just calling them "[model] weight values that tapers smoothly to zero away from detected sources" is not entirely illuminating...but that is out of scope for this ticket, so is up to you!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestions! I have renamed bboxGrow to dcrBBox and moved the definition up to the run method, so that it can be passed in to dcrAssembleSubregion and calculateModelWeights. Then I can remove the duplicated from both those places.

I also updated the documentation.

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