Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-7477: Increase mask plane size to 32 bits #34

Merged
merged 1 commit into from
Jul 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions python/lsst/obs/sdss/convertfpM.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ def convertfpM(infile, allPlanes=False):

planes = hdr[-1].data.field("attributeName").tolist()
values = hdr[-1].data.field("Value").tolist()
mask = afwImage.MaskU(afwGeom.ExtentI(nCols, nRows))
mask = afwImage.Mask(afwGeom.ExtentI(nCols, nRows))

# Minimal sets of mask planes needed for LSST
interpPlane = planes.index("S_MASK_INTERP") + 1
satPlane = planes.index("S_MASK_SATUR") + 1
crPlane = planes.index("S_MASK_CR") + 1

interpBitMask = afwImage.MaskU.getPlaneBitMask("INTRP")
satBitMask = afwImage.MaskU.getPlaneBitMask("SAT")
crBitMask = afwImage.MaskU.getPlaneBitMask("CR")
interpBitMask = afwImage.Mask.getPlaneBitMask("INTRP")
satBitMask = afwImage.Mask.getPlaneBitMask("SAT")
crBitMask = afwImage.Mask.getPlaneBitMask("CR")

listToSet = [(interpPlane, interpBitMask),
(satPlane, satBitMask),
Expand All @@ -144,7 +144,7 @@ def convertfpM(infile, allPlanes=False):
idx = planes.index(plane) + 1
planeName = re.sub("S_MASK_", "", plane)
planeId = mask.addMaskPlane(planeName)
planeBitMask = afwImage.MaskU.getPlaneBitMask(planeName)
planeBitMask = afwImage.Mask.getPlaneBitMask(planeName)
listToSet.append((idx, planeBitMask))

for plane, bitmask in listToSet:
Expand Down
2 changes: 1 addition & 1 deletion tests/testSdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def testGetDR7(self):

msk = ref.get("fpM")
w, h = msk.getWidth(), msk.getHeight()
self.assertEqual(msk.__class__, lsst.afw.image.MaskU)
self.assertEqual(msk.__class__, lsst.afw.image.Mask[lsst.afw.image.MaskPixel])
self.assertEqual(w, 2048)
self.assertEqual(h, 1489)

Expand Down