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-29835: Move background.py from pipe_drivers #704

Merged
merged 22 commits into from Jul 28, 2022
Merged

DM-29835: Move background.py from pipe_drivers #704

merged 22 commits into from Jul 28, 2022

Conversation

timj
Copy link
Member

@timj timj commented Jul 26, 2022

No description provided.

PaulPrice and others added 22 commits July 26, 2022 16:12
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.
@timj timj merged commit dab6c00 into main Jul 28, 2022
@timj timj deleted the tickets/DM-29835 branch July 28, 2022 20:40
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

8 participants