@@ -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
316271def setup_module (module ):
317272 lsst .utils .tests .init ()
0 commit comments