Skip to content

Commit

Permalink
Pass MaskedImage to checkMaskedImageFitsReader
Browse files Browse the repository at this point in the history
instead of Exposure.
  • Loading branch information
arunkannawadi committed Dec 6, 2023
1 parent 98a6847 commit b2a3387
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,20 @@ def checkMultiPlaneReader(self, reader, objectIn, fileName, dtypesOut, compare):
self.assertImagesEqual(image2, object2.image)
compare(subIn, object2)

def checkMaskedImageFitsReader(self, exposureIn, fileName, dtypesOut):
def checkMaskedImageFitsReader(self, maskedImageIn, fileName, dtypesOut):
"""Test MaskedImageFitsReader.
Parameters
----------
exposureIn : `Exposure`
maskedImageIn : `MaskedImage`
Object originally saved, to compare against.
fileName : `str`
Name of the file the reader is reading.
dtypesOut : sequence of `numpy.dype`
Compatible image pixel types to try to read in.
"""
reader = MaskedImageFitsReader(fileName)
self.checkMultiPlaneReader(reader, exposureIn.maskedImage, fileName, dtypesOut,
self.checkMultiPlaneReader(reader, maskedImageIn, fileName, dtypesOut,
compare=self.assertMaskedImagesEqual)

def checkExposureFitsReader(self, exposureIn, fileName, dtypesOut):
Expand Down Expand Up @@ -295,7 +295,7 @@ def testMultiPlaneFitsReaders(self):
exposureIn.setDetector(detector)
with lsst.utils.tests.getTempFilePath(".fits") as fileName:
exposureIn.writeFits(fileName)
self.checkMaskedImageFitsReader(exposureIn, fileName, self.dtypes[n:])
self.checkMaskedImageFitsReader(exposureIn.maskedImage, fileName, self.dtypes[n:])
self.checkExposureFitsReader(exposureIn, fileName, self.dtypes[n:])

def test31035(self):
Expand Down

0 comments on commit b2a3387

Please sign in to comment.