Skip to content

Commit

Permalink
Merge pull request #197 from lsst/tickets/DM-28200
Browse files Browse the repository at this point in the history
DM-28200: reduce jointcal info log verbosity
  • Loading branch information
parejkoj committed Oct 6, 2021
2 parents ba51fcc + 16dcd35 commit 441561d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions python/lsst/jointcal/cameraGeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ def computePixelScale(self):
self.fieldAngle = np.mean(self.fieldAngles, axis=0)
self.fieldAngleStd = np.std(self.fieldAngles, axis=0)
if self.fieldAngleStd.max() > 1e-4:
self.log.warn("Large stddev in computed field angles between visits (max: %s degree).",
self.fieldAngleStd.max())
self.log.warning("Large stddev in computed field angles between visits (max: %s degree).",
self.fieldAngleStd.max())
# import os; print(os.getpid()); import ipdb; ipdb.set_trace();
self.radialScale = np.mean(self.radialScales, axis=0)
self.radialScaleStd = np.std(self.radialScales, axis=0)
if self.radialScaleStd.max() > 1e-4:
self.log.warn("Large stddev in computed radial scales between visits (max: %s arcsec).",
self.radialScaleStd.max())
self.log.warning("Large stddev in computed radial scales between visits (max: %s arcsec).",
self.radialScaleStd.max())
self.tangentialScale = np.mean(self.tangentialScales, axis=0)
self.tangentialScaleStd = np.std(self.tangentialScales, axis=0)
if self.tangentialScaleStd.max() > 1e-4:
self.log.warn("Large stddev in computed tangential scales between visits (max: %s arcsec).",
self.tangentialScaleStd.max())
self.log.warning("Large stddev in computed tangential scales between visits (max: %s arcsec).",
self.tangentialScaleStd.max())

def computeCameraPixelScale(self, detector_id=30):
"""Compute the radial and tangential pixel scales using the distortion
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/jointcal/dataIds.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def makeDataRefList(self, namespace):

for ref in namespace.butler.subset("calexp", dataId=dataId):
if not ref.datasetExists("calexp"):
log.warnf("calexp with dataId: {} not found.", dict(dataId))
log.warning("calexp with dataId: %s not found.", dict(dataId))
continue

# XXX fancier mechanism to select an individual exposure than just pulling out "visit"?
Expand Down
22 changes: 11 additions & 11 deletions python/lsst/jointcal/jointcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def validate(self):
if self.doAstrometry and not self.doPhotometry and self.applyColorTerms:
msg = ("Only doing astrometry, but Colorterms are not applied for astrometry;"
"applyColorTerms=True will be ignored.")
lsst.log.warn(msg)
lsst.log.warning(msg)

def setDefaults(self):
# Use science source selector which can filter on extendedness, SNR, and whether blended
Expand Down Expand Up @@ -1016,7 +1016,7 @@ def _build_ccdImage(self, data, associations, jointcalControl):
if there are no sources in the loaded catalog.
"""
if len(data.catalog) == 0:
self.log.warn("No sources selected in visit %s ccd %s", data.visit, data.detector.getId())
self.log.warning("No sources selected in visit %s ccd %s", data.visit, data.detector.getId())
return None

associations.createCcdImage(data.catalog,
Expand Down Expand Up @@ -1225,8 +1225,8 @@ def _get_refcat_coordinate_error_override(self, refCat, name):
msg)

if self.config.astrometryReferenceErr is not None and 'coord_raErr' in refCat.schema:
self.log.warn("Overriding reference catalog coordinate errors with %f/coordinate [mas]",
self.config.astrometryReferenceErr)
self.log.warning("Overriding reference catalog coordinate errors with %f/coordinate [mas]",
self.config.astrometryReferenceErr)

if self.config.astrometryReferenceErr is None:
return float('nan')
Expand Down Expand Up @@ -1658,11 +1658,11 @@ def _check_stars(self, associations):
self.log.debug("ccdImage %s has %s measured and %s reference stars",
ccdImage.getName(), nMeasuredStars, nRefStars)
if nMeasuredStars < self.config.minMeasuredStarsPerCcd:
self.log.warn("ccdImage %s has only %s measuredStars (desired %s)",
ccdImage.getName(), nMeasuredStars, self.config.minMeasuredStarsPerCcd)
self.log.warning("ccdImage %s has only %s measuredStars (desired %s)",
ccdImage.getName(), nMeasuredStars, self.config.minMeasuredStarsPerCcd)
if nRefStars < self.config.minRefStarsPerCcd:
self.log.warn("ccdImage %s has only %s RefStars (desired %s)",
ccdImage.getName(), nRefStars, self.config.minRefStarsPerCcd)
self.log.warning("ccdImage %s has only %s RefStars (desired %s)",
ccdImage.getName(), nRefStars, self.config.minRefStarsPerCcd)

def _iterate_fit(self, associations, fitter, max_steps, name, whatToFit,
dataName="",
Expand Down Expand Up @@ -1746,12 +1746,12 @@ def _iterate_fit(self, associations, fitter, max_steps, name, whatToFit,

break
elif result == MinimizeResult.Chi2Increased:
self.log.warn("Still some outliers remaining but chi2 increased - retry")
self.log.warning("Still some outliers remaining but chi2 increased - retry")
# Check whether the increase was large enough to cause trouble.
chi2Ratio = chi2.chi2 / oldChi2.chi2
if chi2Ratio > 1.5:
self.log.warn('Significant chi2 increase by a factor of %.4g / %.4g = %.4g',
chi2.chi2, oldChi2.chi2, chi2Ratio)
self.log.warning('Significant chi2 increase by a factor of %.4g / %.4g = %.4g',
chi2.chi2, oldChi2.chi2, chi2Ratio)
# Based on a variety of HSC jointcal logs (see DM-25779), it
# appears that chi2 increases more than a factor of ~2 always
# result in the fit diverging rapidly and ending at chi2 > 1e10.
Expand Down
4 changes: 2 additions & 2 deletions src/Associations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void Associations::associateCatalogs(const double matchCutInArcSec, const bool u
ms->setFittedStar(fs);
matchedCount++;
}
LOGLS_INFO(_log, "Matched " << matchedCount << " objects in " << ccdImage->getName());
LOGLS_DEBUG(_log, "Matched " << matchedCount << " objects in " << ccdImage->getName());

// add unmatched objets to FittedStarList
int unMatchedCount = 0;
Expand All @@ -189,7 +189,7 @@ void Associations::associateCatalogs(const double matchCutInArcSec, const bool u
}
unMatchedCount++;
}
LOGLS_INFO(_log, "Unmatched objects: " << unMatchedCount);
LOGLS_DEBUG(_log, "Unmatched objects: " << unMatchedCount);
} // end of loop on CcdImages

// !!!!!!!!!!!!!!!!!
Expand Down
10 changes: 5 additions & 5 deletions src/FitterBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ std::size_t FitterBase::findOutliers(double nSigmaCut, MeasuredStarList &msOutli
nOutliers++;
}
} // end loop on measurements/references
LOGLS_INFO(_log, "findOutliers: found " << msOutliers.size() << " meas outliers and " << fsOutliers.size()
<< " ref outliers ");
LOGLS_DEBUG(_log, "findOutliers: found " << msOutliers.size() << " meas outliers and "
<< fsOutliers.size() << " ref outliers ");

return nOutliers;
}
Expand Down Expand Up @@ -255,10 +255,10 @@ MinimizeResult FitterBase::minimize(std::string const &whatToFit, double nSigmaC
LOGLS_DEBUG(_log, "findOutliers chi2 cut level: " << sigmaCut << ", relative change: " << relChange);
// If sigmaRelativeTolerance is set and at least one iteration has been done, break loop when the
// fractional change in sigmaCut levels is less than the sigmaRelativeTolerance parameter.
if ((sigmaRelativeTolerance > 0) && (oldSigmaCut > 0 && relChange < sigmaRelativeTolerance)){
if ((sigmaRelativeTolerance > 0) && (oldSigmaCut > 0 && relChange < sigmaRelativeTolerance)) {
LOGLS_INFO(_log, "Iterations stopped with chi2 cut at " << sigmaCut << " and relative change of "
<< relChange);
break;
<< relChange);
break;
}
totalMeasOutliers += msOutliers.size();
totalRefOutliers += fsOutliers.size();
Expand Down

0 comments on commit 441561d

Please sign in to comment.