Skip to content

Commit 4761e66

Browse files
committed
Save work for rebase
1 parent 8828274 commit 4761e66

File tree

2 files changed

+1
-48
lines changed

2 files changed

+1
-48
lines changed

python/lsst/ip/diffim/getTemplate.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ def getOverlappingExposures(self, inputs):
197197
if patchPolygon.intersection(detectorPolygon):
198198
overlappingArea += patchPolygon.intersectionSingle(detectorPolygon).calculateArea()
199199
self.log.info("Using template input tract=%s, patch=%s", dataId['tract'], dataId['patch'])
200-
coaddPatch = coaddRef.get()
201-
self.checkPatch(coaddPatch, dataId)
202-
coaddExposures[dataId['tract']].append(coaddPatch)
200+
coaddExposures[dataId['tract']].append(coaddRef.get())
203201
dataIds[dataId['tract']].append(dataId)
204202

205203
if not overlappingArea:

tests/test_getTemplate.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -267,51 +267,6 @@ def testMissingPatches(self):
267267
self.assertTrue(all(np.isnan(result.template.variance.array[no_data])))
268268
self.assertEqual(no_data.sum(), 21548)
269269

270-
@patch('lsst.log.WARNING')
271-
def testCheckPatchGoodPixels(self, mock_warning):
272-
""" Check that coadd with no nan pixels and doesn't raise invalid pixel
273-
warning.
274-
"""
275-
getTemplate = lsst.ip.diffim.getTemplate.GetTemplateTask()
276-
coaddPatch = self.exposure
277-
dataId = self.dataIds[0]
278-
getTemplate.checkPatch(coaddPatch, dataId)
279-
self.assertEqual(mock_warning.call_count, 0)
280-
281-
@patch('lsst.log.WARNING')
282-
def testCheckPatchOneBadPixel(self, mock_warning):
283-
""" Check that coadd with one bad pixel raises one warning.
284-
"""
285-
getTemplate = lsst.ip.diffim.getTemplate.GetTemplateTask()
286-
coaddPatch = self.exposure
287-
coaddPatch[0, 0] = (np.nan, 32, 4.0)
288-
dataId = self.dataIds[0]
289-
getTemplate.checkPatch(coaddPatch, dataId)
290-
self.assertEqual(mock_warning.call_count, 1)
291-
292-
@patch('lsst.log.WARNING')
293-
def testCheckPatchBadPixels(self, mock_warning):
294-
""" Check that coadd with multiple bad pixels raises a single warning.
295-
"""
296-
self.assertEqual(mock_warning.call_count, 1)
297-
298-
@patch('lsst.log.WARNING')
299-
def testRunTemplateBadPixels(self):
300-
"""Test a bounding box that fully fits inside one tract, with only
301-
that tract passed as input. This checks that the code handles a single
302-
tract input correctly.
303-
"""
304-
box = lsst.geom.Box2I(lsst.geom.Point2I(0, 0), lsst.geom.Point2I(180, 180))
305-
task = lsst.ip.diffim.GetTemplateTask()
306-
# Restrict to tract 0, since the box fits in just that tract.
307-
# Task modifies the input bbox, so pass a copy.
308-
result = task.run({0: self.patches[0]}, lsst.geom.Box2I(box),
309-
self.exposure.wcs, {0: self.dataIds[0]}, "a_test")
310-
311-
# All 4 patches from tract 0 are included in this template.
312-
self._checkMetadata(result.template, task.config, box, self.exposure.wcs, 4)
313-
self._checkPixels(result.template, task.config, box)
314-
315270

316271
def setup_module(module):
317272
lsst.utils.tests.init()

0 commit comments

Comments
 (0)