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-13741: Tweak background in DynamicDetectionTask #106
Conversation
We want to be able to return multiple backgrounds from the DynamicDetectionTask, even if we only have one in the vanilla SourceDetectionTask. Returning a list of backgrounds is easier for the user to handle than looking for multiple elements. Approved in RFC-463.
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.
Found a doc typo. Would also just to make sure I understand how and where we're using various options.
|
||
return results | ||
|
||
def tweakBackground(self, exposure, bgLevel, bgList=None): | ||
"""Modify the background to by a constant value |
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 or extra word
|
||
class DynamicDetectionConfig(SourceDetectionConfig): | ||
"""Configuration for DynamicDetectionTask""" | ||
prelimThresholdFactor = Field(dtype=float, default=0.5, | ||
doc="Fraction of the threshold to use for first pass (to find sky objects)") | ||
skyObjects = ConfigurableField(target=SkyObjectsTask, doc="Generate sky objects") | ||
doBackgroundTweak = Field(dtype=bool, default=True, | ||
doc="Tweak background level so median PSF flux of sky objects is zero?") |
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.
Just checking:
- for coadds, we use
reEstimateBackground = False, doBackgroundTweak=True
- in processCcd, we use
reEstimateBackground = True
, anddoBackgroundTweak
isn't relevant because we're not usingDynamicDetectionTask
?
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.
Yes. But there's no fundamental reason why you couldn't turn both background subtractions on in DynamicDetectionTask
.
bgStats.set(0, 0, (bgLevel, 0, bgLevel)) | ||
bg = lsst.afw.math.BackgroundMI(exposure.getBBox(), bgStats) | ||
bgData = (bg, lsst.afw.math.Interpolate.LINEAR, lsst.afw.math.REDUCE_INTERP_ORDER, | ||
lsst.afw.math.ApproximateControl.UNKNOWN, 0, 0, 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.
Sad that there isn't a simpler way to make a background object that corresponds to a constant, but I'll trust that it works and that you looked for something 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.
Yeah, I'd love to see all the background modelling stuff redesigned, but now's not the time.
Add tweak of background level to match photometry of sky objects. This has to be done first during the detection phase and then again later after any temporary backgrounds that were removed have been restored so that the final product has the correct background.
4454633
to
f60dd76
Compare
No description provided.