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-15635: Approximate filter throughput for DcrCoadds #227
Conversation
modelWidth = pexConfig.Field( | ||
dtype=int, | ||
doc="Width of the region around detected sources to include in the DcrModel." | ||
"Set to a negative number to disable, which will include all pixels.", |
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.
Unless you care to convince me otherwise, I'd prefer an error to be raised if a nonsensical modelWidth < 0 is chosen. Later it uses a negative value to set all the weights to 1, which seems dangerous; wouldn't throwing an exception be safer? It's also not clear to me why 3 is a good 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.
That's a good point. I'll make it raise an exception on negative values, and will add a separate config parameter to turn it on or off.
"Set to a negative number to disable, which will include all pixels.", | ||
default=3, | ||
) | ||
useSubfilterMidpoint = pexConfig.Field( |
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.
Could this be called useMidpoint
like in ip_diffim? (Or, alternately, could the one in ip_diffim be called useSubfilterMidpoint
? Mostly I'm seeking consistency!)
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've switched the name to splitSubfilters
, and used it consistently throughout.
Or a placeholder value of 1.0 if ``self.config.modelWidth`` is set to a negative number. | ||
""" | ||
if self.config.modelWidth < 0: | ||
return 1. |
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.
Again, I don't like this sneaky behavior. If you want a fallback option to have all the weights be 1, that should be an explicit option, not something that happens if the width is set negative.
0dac5d9
to
9a95dfd
Compare
9a95dfd
to
aa0b13d
Compare
@@ -470,6 +492,9 @@ def dcrAssembleSubregion(self, dcrModels, bbox, tempExpRefList, imageScalerList, | |||
The variance of each coadded subfilter image. | |||
gain : `float`, optional | |||
Relative weight to give the new solution when updating the model. | |||
modelWeights : `numpy.ndarray` or `float` | |||
A 2D array of weight values that tapers smoothly to zero away from detected sources. | |||
Set to a placeholder value of 1.0 if ``self.config.modelWeightsWidth`` is False. |
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.
Set to a placeholder value of 1.0 if ``self.config.modelWeightsWidth`` is False. | |
Set to a placeholder value of 1.0 if ``self.config.useModelWeights`` is False. |
aa0b13d
to
c0de044
Compare
No description provided.