Skip to content

Commit

Permalink
Fix test to once more read HDUs 1, 2, 3
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLuptonTheGood committed Apr 4, 2017
1 parent 0ad3a5f commit 0ee3d31
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/testDM-329.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ class DM329TestCase(unittest.TestCase):
def testHdu(self):
mapper = MinMapper2()
butler = dafPersist.ButlerFactory(mapper=mapper).create()
# HDU INT_MIN returns (header-only) primary array
# HDU 0 returns first image plane
# HDU 1 returns mask plane
# HDU 2 returns variance plane
for i in (0, 1, 2):
# HDU INT_MIN returns primary array (skipping empty PDU)
# HDU 0 returns (header-only) PDU
# HDU 1 returns first image plane
# HDU 2 returns mask plane
# HDU 3 returns variance plane
for i in (1, 2, 3):
loc = mapper.map("other", dict(ccd=35, hdu=i))
expectedLocations = ["bar-35.fits[%d]" % (i,)]
self.assertEqual(loc.getStorage().root, testDir)
Expand All @@ -74,8 +75,8 @@ def testHdu(self):
self.assertIsInstance(image, lsst.afw.image.ImageF)
self.assertEqual(image.getHeight(), 2024)
self.assertEqual(image.getWidth(), 2248)
self.assertEqual(image.get(200, 25), (0.0, 20.0, 0.0)[i])
self.assertAlmostEqual(image.get(200, 26), (1.20544, 0.0, 5.82185)[i], places=5)
self.assertEqual(image.get(200, 25), (0.0, 20.0, 0.0)[i-1])
self.assertAlmostEqual(image.get(200, 26), (1.20544, 0.0, 5.82185)[i-1], places=5)


class MemoryTester(lsst.utils.tests.MemoryTestCase):
Expand Down

0 comments on commit 0ee3d31

Please sign in to comment.