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-13741: Tweak background in DynamicDetectionTask #106

Merged
merged 2 commits into from Mar 17, 2018

Conversation

PaulPrice
Copy link
Contributor

No description provided.

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.
Copy link
Member

@TallJimbo TallJimbo left a 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
Copy link
Member

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?")
Copy link
Member

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, and doBackgroundTweak isn't relevant because we're not using DynamicDetectionTask?

Copy link
Contributor Author

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)
Copy link
Member

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.

Copy link
Contributor Author

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.
@PaulPrice PaulPrice merged commit f60dd76 into master Mar 17, 2018
@ktlim ktlim deleted the tickets/DM-13741 branch August 25, 2018 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants