Skip to content

Commit

Permalink
Set python logging for obs packages
Browse files Browse the repository at this point in the history
Although this command seems to be gen2 butler at the moment.
  • Loading branch information
timj committed Jul 5, 2024
1 parent f2686f8 commit eeed205
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bin.src/showCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
import logging
import sys
import matplotlib.pyplot as plt

import lsst.afw.cameraGeom.utils as cameraGeomUtils
from lsst.log import Log

if __name__ == '__main__':
import argparse
Expand Down Expand Up @@ -64,10 +64,10 @@
print("Unable to find mapper {mapperName} in {obsPackageName}", file=sys.stderr)
sys.exit(1)
#
# Control verbosity from butler
# Control verbosity from obs packages
#
log = Log.getLogger("CameraMapper")
log.setLevel(Log.FATAL)
log = logging.getLogger("lsst.obs")
log.setLevel(logging.FATAL)
#
# And finally find the camera
#
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/afw/cameraGeom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def getCcdImage(self, ccd, imageFactory=afwImage.ImageF, binSize=1, asMaskedImag
if self.callback:
try:
im = self.callback(im, ccd, imageSource=self)
except Exception as e:
except Exception:
if self.verbose:
log.exception("callback failed.")
im = imageFactory(*bbox.getDimensions())
Expand Down Expand Up @@ -917,7 +917,7 @@ def makeImageFromCamera(camera, detectorNameList=None, background=numpy.nan, buf
imView = camIm.Factory(camIm, bbox, afwImage.LOCAL)
try:
imView[:] = im
except pexExceptions.LengthError as e:
except pexExceptions.LengthError:
log.exception("Unable to fit image for detector \"%s\" into image of camera.", det.getName())

return camIm
Expand Down
1 change: 1 addition & 0 deletions python/lsst/afw/image/_image/_fitsIoWithOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

_LOG = logging.getLogger("lsst.afw.image")


# This must be added to a class as a *classmethod*, for example:
#
# @continueclass
Expand Down

0 comments on commit eeed205

Please sign in to comment.