Skip to content

Commit

Permalink
Change back to use pexLog.Debug directly
Browse files Browse the repository at this point in the history
With the logging framework changes in pipe_base, Tasks' logs
is transitioned from pex.logging to lsst.log, and negative logging
levels are no longer used. To facilitate logging framework migration,
usage of pexLog.Debug is separated. Practically this commit reverts
part of the changes in 33520d7
  • Loading branch information
Hsin-Fang Chiang committed Aug 25, 2016
1 parent 712ab46 commit 739d91e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/lsst/meas/extensions/psfex/psfexPsfDeterminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import lsst.daf.base as dafBase
import lsst.pex.config as pexConfig
import lsst.pex.logging as pexLog
import lsst.afw.geom as afwGeom
import lsst.afw.geom.ellipses as afwEll
import lsst.afw.display.ds9 as ds9
Expand Down Expand Up @@ -154,6 +155,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
normalizeResiduals = lsstDebug.Info(__name__).normalizeResiduals
# Normalise residuals by object amplitude

debugLog = pexLog.Debug("meas.algorithms.psfDeterminer")
mi = exposure.getMaskedImage()

nCand = len(psfCandidateList)
Expand All @@ -175,7 +177,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
if psfCellSet:
psfCellSet.insertCandidate(psfCandidate)
except Exception, e:
self.log.log(-2, "Skipping PSF candidate %d of %d: %s" % (i, len(psfCandidateList), e))
debugLog.debug(2, "Skipping PSF candidate %d of %d: %s" % (i, len(psfCandidateList), e))
continue

source = psfCandidate.getSource()
Expand All @@ -184,7 +186,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
sizes[i] = rmsSize

if self.config.kernelSize >= 15:
self.log.log(-1, \
debugLog.debug(1, \
"WARNING: NOT scaling kernelSize by stellar quadrupole moment, but using absolute value")
actualKernelSize = int(self.config.kernelSize)
else:
Expand All @@ -203,7 +205,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
pixKernelSize = int(actualKernelSize*self.config.samplingSize)
if pixKernelSize % 2 == 0:
pixKernelSize += 1
self.log.log(-3, "Psfex Kernel size=%.2f, Image Kernel Size=%.2f" %
debugLog.debug(3, "Psfex Kernel size=%.2f, Image Kernel Size=%.2f" %
(actualKernelSize,pixKernelSize))
psfCandidateList[0].setHeight(pixKernelSize)
psfCandidateList[0].setWidth(pixKernelSize)
Expand Down Expand Up @@ -314,7 +316,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
for j in range(set.getNcontext()):
sample.setContext(j, float(contextvalp[j][i]))
except Exception as e:
self.log.log(-2, "Exception when processing sample at (%f,%f): %s" % (xc, yc, e))
debugLog.debug(2, "Exception when processing sample at (%f,%f): %s" % (xc, yc, e))
continue
else:
set.finiSample(sample)
Expand Down

0 comments on commit 739d91e

Please sign in to comment.