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-29835: Move background.py from pipe_drivers #704
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A sky frame is the dominant response of the camera to the sky. It is constructed by first subtracting a large-scale focal plane background model (e.g., 1024x1024) from all frames to remove large-scale gradients, binning pixels in each CCD (e.g., 64x64) and then averaging those.
The transform direction changed in warpImage(..., TransformPoint2Point2, ...) to match the older warpImage(..., XYTransform, ...). Update accordingly.
This reverts commit 7a563fe4d835cdceba77592e7e8dcd6960a83968.
This config parameter was used in prototype implementations of the code, controlling features that no longer exist.
The transform direction changed in warpImage(..., TransformPoint2Point2, ...) to match the older warpImage(..., XYTransform, ...). Update accordingly.
/tigress/HSC/stack/hsc3-perseus-20171206/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_drivers/6.0b6-hsc/python/lsst/pipe/drivers/background.py:331: RuntimeWarning: invalid value encountered in greater bad = numpy.abs(residuals) > self.config.skyRej*stdev
SkyMeasurementTask.measureScale uses zip to iterate over x and y limits, so it's only iterating over the diagonal of the image. Using itertools.product, we iterate over the entire image.
Nate Lust encouraged me to consider what happens when the number of samples is larger than the image, which identified some off-by-one issues. The limits now run to the edge of the image, and we subtract one from the bounding box end point because that is inclusive.
This task does multiple detection passes to get a good sky level unaffected by the wings of objects. This will be used in constructSky and skyCorrection.
We need to interpolate in two dimensions instead of one, since chip gaps can extend completely across a single dimension of the camera.
All pixels in the new numberator image are 1.0, and multiplying with the convolved image has no effect.
As noted in FocalPlaneBackgroundConfig() "the focal plane frame is usually defined in units of microns or millimetres rather than pixels. As such, their values will need to be revised according to each particular camera." The algorithm here was developed and battle-tested against HSC in the context of a camera focal plane defined in "pixels", but it is meant to accommodate FPs defined in other units. It turns out one place -- the setting of the threshold for the minimum number of pixels contributing for a bin to be considered "good" -- was failing to accommodate FP units other than "pixel". This accommodation is made here by adding a config defining the size of a detector pixel in the units for which the given camera geoms focal plane is defined.
…lass This is needed to convert an existing pipe_drivers variant into a pipe_tasks variant.
This code used to be in pipe_drivers and any pickled objects require that the pipe_drivers package exist when unpickled. Since we do not want pipe_drivers to exist indefinitely, we instead dynamically create a lsst.pipe.drivers.background module and attach the relevant classes.
czwa
approved these changes
Jul 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.