Skip to content

Commit

Permalink
Simplify logging enabled by updates in pipe_base
Browse files Browse the repository at this point in the history
The creation of a python logger to pass to piff with forwarding to lsst.log
is no longer necessary here thanks to recent updates in pipe_base (DM-30301).

The addition of _DefaultName ensures the log message will include the class
name (i.e. to be able to clearly identify where the message is coming from).
  • Loading branch information
laurenam committed Aug 10, 2021
1 parent a86695c commit edc2e8a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions python/lsst/meas/extensions/piff/piffPsfDeterminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@

__all__ = ["PiffPsfDeterminerConfig", "PiffPsfDeterminerTask"]

import logging

import numpy as np
import piff
import galsim

import lsst.log
import lsst.pex.config as pexConfig
import lsst.meas.algorithms as measAlg
from lsst.meas.algorithms.psfDeterminer import BasePsfDeterminerTask
Expand Down Expand Up @@ -175,6 +172,7 @@ class PiffPsfDeterminerTask(BasePsfDeterminerTask):
"""A measurePsfTask PSF estimator using Piff as the implementation.
"""
ConfigClass = PiffPsfDeterminerConfig
_DefaultName = "psfDeterminer.Piff"

def determinePsf(
self, exposure, psfCandidateList, metadata=None, flagKey=None
Expand Down Expand Up @@ -255,10 +253,7 @@ def determinePsf(
wcs = {0: galsim.PixelScale(1.0)}
pointing = None

logger = logging.getLogger(self.log.getName()+".Piff")
logger.addHandler(lsst.log.LogHandler())

piffResult.fit(stars, wcs, pointing, logger=logger)
piffResult.fit(stars, wcs, pointing, logger=self.log)
psf = PiffPsf(kernelSize, kernelSize, piffResult)

used_image_pos = [s.image_pos for s in piffResult.stars]
Expand Down

0 comments on commit edc2e8a

Please sign in to comment.