Coverage for python/lsst/obs/sdss/convertfpM.py : 74%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # LSST Data Management System # Copyright 2008, 2009, 2010 LSST Corporation. # # 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, # see <http://www.lsstcorp.org/LegalNotices/>. #
self.nspan = 0 # some bogus fpM files
# Some fpM files are actually wrong and this test fails! # So warn, not assert # 5759/40/objcs/1/fpM-005759-r1-0011.fit # Plane S_MASK_NOTCHECKED print("WARNING: npix != npixcheck (%d != %d)" % (self.npix, npixcheck))
continue
x1 = 0
x2 = ncol - 1
raise LookupError("Missing data in fpM header")
# Minimal sets of mask planes needed for LSST
(satPlane, satBitMask), (crPlane, crBitMask)]
# Add the rest of the SDSS planes for plane in ['S_MASK_NOTCHECKED', 'S_MASK_OBJECT', 'S_MASK_BRIGHTOBJECT', 'S_MASK_BINOBJECT', 'S_MASK_CATOBJECT', 'S_MASK_SUBTRACTED', 'S_MASK_GHOST']: idx = planes.index(plane) + 1 planeName = re.sub("S_MASK_", "", plane) mask.addMaskPlane(planeName) planeBitMask = afwImage.Mask.getPlaneBitMask(planeName) listToSet.append((idx, planeBitMask))
continue
continue
infile = sys.argv[1] outfile = sys.argv[2]
if not os.path.isfile(infile): sys.exit(1)
convertfpM(infile).writeFits(outfile)
comparison = """ # noqa ignore the really long line import lsst.afw.image as afwImage import numpy as num import os
readMask = "/astro/users/acbecker/LSST/lsst_devel/clue/Coadd/src/native/SDSS_PSFs/readAtlasImages_mod_by_Keith/src/read_mask" cmd = readMask + " %s INTERP /tmp/interp.fit" os.system(cmd) cmd = readMask + " %s SATUR /tmp/satur.fit" os.system(cmd) cmd = readMask + " %s CR /tmp/cr.fit" os.system(cmd)
interp = afwImage.ImageU("/tmp/interp.fit") interp *= 2**2
sat = afwImage.ImageU("/tmp/satur.fit") sat *= 2**1
cr = afwImage.ImageU("/tmp/cr.fit") cr *= 2**3
interp += sat interp += cr
lsst = afwImage.ImageU("%s") interp -= lsst interp.writeFits("/tmp/mask_diff.fits") print len(num.where(interp.getArray() != 0)[0])
""" % (infile, infile, infile, outfile) print(comparison) |