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 #84

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
14 changes: 7 additions & 7 deletions python/lsst/meas/algorithms/secondMomentStarSelector.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#
#
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, but put this on a separate commit.

# see <https://www.lsstcorp.org/LegalNotices/>.
#
from builtins import range
Expand Down Expand Up @@ -421,7 +421,7 @@ def getClumps(self, sigma=1.0, display=False):
#
# Now measure that image, looking for the highest peak. Start by building an Exposure
#
msk = afwImage.MaskU(largeImg.getDimensions())
msk = afwImage.Mask(largeImg.getDimensions())
msk.set(0)
var = afwImage.ImageF(largeImg.getDimensions())
var.set(1)
Expand Down
14 changes: 7 additions & 7 deletions python/lsst/meas/algorithms/subtractBackground.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#
#
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

# see <https://www.lsstcorp.org/LegalNotices/>.
#
__all__ = ("SubtractBackgroundConfig", "SubtractBackgroundTask")
Expand Down Expand Up @@ -88,7 +88,7 @@ class SubtractBackgroundConfig(pexConfig.Config):
ignoredPixelMask = pexConfig.ListField(
doc="Names of mask planes to ignore while estimating the background",
dtype=str, default=["BAD", "EDGE", "DETECTED", "DETECTED_NEGATIVE", "NO_DATA", ],
itemCheck=lambda x: x in afwImage.MaskU().getMaskPlaneDict().keys(),
itemCheck=lambda x: x in afwImage.Mask().getMaskPlaneDict().keys(),
)
isNanSafe = pexConfig.Field(
doc="Ignore NaNs when estimating the background",
Expand Down
14 changes: 7 additions & 7 deletions python/lsst/meas/algorithms/testUtils.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#
#
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

# see <https://www.lsstcorp.org/LegalNotices/>.
#
#!/usr/bin/env python
Expand Down Expand Up @@ -68,7 +68,7 @@ def plantSources(bbox, kwid, sky, coordList, addPoissonNoise=True):
imgArr[:] = numpy.random.poisson(imgArr)

# bundle into a maskedimage and an exposure
mask = afwImage.MaskU(bbox)
mask = afwImage.Mask(bbox)
var = img.convertFloat()
img -= sky
mimg = afwImage.MaskedImageF(img.convertFloat(), mask, var)
Expand Down
4 changes: 2 additions & 2 deletions tests/testPsfSelectTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ def plantSources(x0, y0, nx, ny, sky, nObj, wid, detector, useRandom=False):
noise0.set(i, j, np.random.poisson(img0.get(i, j)))

edgeWidth = int(0.5*edgeBuffer)
mask = afwImage.MaskU(afwGeom.ExtentI(nx, ny))
mask = afwImage.Mask(afwGeom.ExtentI(nx, ny))
left = afwGeom.Box2I(afwGeom.Point2I(0, 0), afwGeom.ExtentI(edgeWidth, ny))
right = afwGeom.Box2I(afwGeom.Point2I(nx - edgeWidth, 0), afwGeom.ExtentI(edgeWidth, ny))
top = afwGeom.Box2I(afwGeom.Point2I(0, ny - edgeWidth), afwGeom.ExtentI(nx, edgeWidth))
bottom = afwGeom.Box2I(afwGeom.Point2I(0, 0), afwGeom.ExtentI(nx, edgeWidth))

for pos in [left, right, top, bottom]:
msk = afwImage.MaskU(mask, pos, deep=False)
msk = afwImage.Mask(mask, pos, deep=False)
msk.set(msk.getPlaneBitMask('EDGE'))

expos = afwImage.makeExposure(afwImage.makeMaskedImage(noise, mask, afwImage.ImageF(noise, True)))
Expand Down