Skip to content

Commit

Permalink
fix SkyMeasurementTask.measureScale
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
michitaro authored and PaulPrice committed Jan 14, 2019
1 parent d2eeba5 commit 0e355d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/lsst/pipe/drivers/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ def measureScale(self, image, skyBackground):
statistic = afwMath.stringToStatisticsProperty(self.config.stats.statistic)
imageSamples = []
skySamples = []
for xStart, yStart, xStop, yStop in zip(xLimits[:-1], yLimits[:-1], xLimits[1:], yLimits[1:]):
for xIndex, yIndex in itertools.product(range(self.config.xNumSamples),
range(self.config.yNumSamples)):
xStart, xStop = xLimits[xIndex], xLimits[xIndex + 1]
yStart, yStop = yLimits[yIndex], yLimits[yIndex + 1]
box = afwGeom.Box2I(afwGeom.Point2I(xStart, yStart), afwGeom.Point2I(xStop, yStop))
subImage = image.Factory(image, box)
subSky = sky.Factory(sky, box)
Expand Down

0 comments on commit 0e355d9

Please sign in to comment.