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-31228: Clean up some logging usage #376

Merged
merged 1 commit into from
Jul 29, 2021
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
10 changes: 5 additions & 5 deletions python/lsst/obs/hsc/calibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def maskVignetting(self, mask, detector):
numCorners = sum(math.hypot(*(fpPos - fpCenter)) > self.config.vignette.radius for fpPos in fpCorners)
if numCorners == 0:
# Nothing to be masked
self.log.info("Detector %d is unvignetted" % detector.getId())
self.log.info("Detector %d is unvignetted", detector.getId())
return
if numCorners == 4:
# Everything to be masked
# We ignore the question of how we're getting any data from a CCD
# that's totally vignetted...
self.log.warn("Detector %d is completely vignetted" % detector.getId())
self.log.warning("Detector %d is completely vignetted", detector.getId())
mask |= bitMask
return
# We have to go pixel by pixel
Expand All @@ -82,8 +82,8 @@ def maskVignetting(self, mask, detector):
origin = geom.Point2D(self.config.vignette.xCenter, self.config.vignette.yCenter)
r2 = np.array([pp.distanceSquared(origin) for pp in xyFocalPlane])
isBad = (r2 > self.config.vignette.radius**2).reshape((h, w))
self.log.info("Detector %d has %f%% pixels vignetted" %
(detector.getId(), isBad.sum()/float(isBad.size)*100.0))
self.log.info("Detector %d has %f%% pixels vignetted",
detector.getId(), isBad.sum()/float(isBad.size)*100.0)
maskArray = mask.getArray()
maskArray[yy[isBad], xx[isBad]] |= bitMask

Expand Down Expand Up @@ -114,4 +114,4 @@ def maskBadAmps(self, mask, detector):
subMask |= bitMask
break
if not found:
self.log.warn("Unable to find amp=%s in ccd=%s" % (ampNum, ccdNum))
self.log.warning("Unable to find amp=%s in ccd=%s", ampNum, ccdNum)
2 changes: 1 addition & 1 deletion python/lsst/obs/subaru/_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def ingestStrayLightData(self, butler, directory, *, transfer=None, collection=N
for detector in self.getCamera():
path = os.path.join(directory, f"ybackground-{detector.getId():03d}.fits")
if not os.path.exists(path):
log.warning(f"No stray light data found for detector {detector.getId()} @ {path}.")
log.warning("No stray light data found for detector %s @ %s.", detector.getId(), path)
continue
ref = DatasetRef(datasetType, dataId={"instrument": self.getName(),
"detector": detector.getId(),
Expand Down
8 changes: 4 additions & 4 deletions python/lsst/obs/subaru/crosstalkYagi.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ def run(self, exposure):
coeffs2List = self.config.coeffs.getCoeffs2() # secondary crosstalk
gainsPreampSig = self.config.coeffs.getGainsPreampSigboard()
if not np.any(coeffs1List):
self.log.info("No crosstalk info available. Skipping crosstalk corrections to CCD %s" %
(exposure.getDetector().getId()))
self.log.info("No crosstalk info available. Skipping crosstalk corrections to CCD %s",
exposure.getDetector().getId())
return

self.log.info("Applying crosstalk corrections to CCD %s based on Yagi+2012" %
(exposure.getDetector().getId()))
self.log.info("Applying crosstalk corrections to CCD %s based on Yagi+2012",
exposure.getDetector().getId())

ccdId = int(exposure.getDetector().getId().getSerial())
gainsPreampSigCcd = gainsPreampSig[ccdId]
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/subaru/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def translate_pointing(self, md):
except Exception:
pass

self.log.warn("Unable to determine suitable 'pointing' value; using 0")
self.log.warning("Unable to determine suitable 'pointing' value; using 0")
return 0

# CCD index mapping for commissioning run 2
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/obs/subaru/strayLight/yStrayLight.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ def run(self, exposure, strayLightData):
if self.config.doRotatorAngleCorrection:
angleStart, angleEnd = inrStartEnd(exposure.getInfo().getVisitInfo())
self.log.debug(
"(INR-STR, INR-END) = ({:g}, {:g}) (FITS header says ({:g}, {:g})).".format(
angleStart, angleEnd,
exposureMetadata.getDouble('INR-STR'), exposureMetadata.getDouble('INR-END'))
"(INR-STR, INR-END) = (%g, %g) (FITS header says (%g, %g)).",
angleStart, angleEnd,
exposureMetadata.getDouble('INR-STR'), exposureMetadata.getDouble('INR-END')
)
else:
angleStart = exposureMetadata.getDouble('INR-STR')
Expand Down