diff --git a/python/lsst/ip/diffim/dipoleFitTask.py b/python/lsst/ip/diffim/dipoleFitTask.py index 39ea0f5cf..fe145f951 100644 --- a/python/lsst/ip/diffim/dipoleFitTask.py +++ b/python/lsst/ip/diffim/dipoleFitTask.py @@ -1239,7 +1239,7 @@ def fail(self, measRecord, error=None): measRecord.set(self.flagKey, True) if error is not None: if error.getFlagBit() == self.FAILURE_EDGE: - self.log.warning('DipoleFitPlugin not run on record %d: %s', measRecord.getId(), str(error)) + self.log.debug('DipoleFitPlugin not run on record %d: %s', measRecord.getId(), str(error)) measRecord.set(self.edgeFlagKey, True) if error.getFlagBit() == self.FAILURE_FIT: self.log.warning('DipoleFitPlugin failed on record %d: %s', measRecord.getId(), str(error)) diff --git a/python/lsst/ip/diffim/getTemplate.py b/python/lsst/ip/diffim/getTemplate.py index 49e85ce89..50b97e60e 100644 --- a/python/lsst/ip/diffim/getTemplate.py +++ b/python/lsst/ip/diffim/getTemplate.py @@ -127,8 +127,8 @@ def getOverlappingExposures(self, inputs): Parameters ---------- inputs : `dict` of task Inputs, containing: - - coaddExposureRefs : `list` - [`lsst.daf.butler.DeferredDatasetHandle` of + - coaddExposureRefs : `list` \ + [`lsst.daf.butler.DeferredDatasetHandle` of \ `lsst.afw.image.Exposure`] Data references to exposures that might overlap the detector. - bbox : `lsst.geom.Box2I` @@ -373,8 +373,8 @@ def getOverlappingExposures(self, inputs): Parameters ---------- inputs : `dict` of task Inputs, containing: - - coaddExposureRefs : `list` - [`lsst.daf.butler.DeferredDatasetHandle` of + - coaddExposureRefs : `list` \ + [`lsst.daf.butler.DeferredDatasetHandle` of \ `lsst.afw.image.Exposure`] Data references to exposures that might overlap the detector. - bbox : `lsst.geom.Box2I` diff --git a/python/lsst/ip/diffim/imageDecorrelation.py b/python/lsst/ip/diffim/imageDecorrelation.py index 604c09813..f85a4ae2f 100644 --- a/python/lsst/ip/diffim/imageDecorrelation.py +++ b/python/lsst/ip/diffim/imageDecorrelation.py @@ -507,7 +507,7 @@ def estimateVariancePlane(vplane1, vplane2, c1ft, c2ft): as a weighted sum of the input variances. Notes - ------ + ----- See DMTN-179 Section 5 about the variance plane calculations. """ w1 = np.sum(np.real(np.conj(c1ft)*c1ft)) / c1ft.size @@ -541,7 +541,7 @@ def calculateVariancePlane(self, vplane1, vplane2, varMean1, varMean2, c1ft, c2f The variance plane of the difference/score images. Notes - ------ + ----- See DMTN-179 Section 5 about the variance plane calculations. Infs and NaNs are allowed and kept in the returned array. diff --git a/src/BasisLists.cc b/src/BasisLists.cc index 8828caa4e..2d19d4265 100644 --- a/src/BasisLists.cc +++ b/src/BasisLists.cc @@ -11,8 +11,6 @@ #include #include -#include "boost/timer.hpp" - #include "lsst/pex/exceptions/Exception.h" #include "lsst/daf/base/PropertySet.h" #include "lsst/afw/image.h" diff --git a/src/BuildSpatialKernelVisitor.cc b/src/BuildSpatialKernelVisitor.cc index dccb4e98f..3cc93ea90 100644 --- a/src/BuildSpatialKernelVisitor.cc +++ b/src/BuildSpatialKernelVisitor.cc @@ -10,7 +10,6 @@ */ #include -#include "boost/timer.hpp" #include "Eigen/Core" #include "Eigen/Cholesky" diff --git a/src/ImageSubtract.cc b/src/ImageSubtract.cc index 87c7bdb72..0eec712db 100644 --- a/src/ImageSubtract.cc +++ b/src/ImageSubtract.cc @@ -35,7 +35,7 @@ #include #include -#include "boost/timer.hpp" +#include "boost/timer/timer.hpp" #include "Eigen/Core" @@ -120,8 +120,7 @@ afwImage::MaskedImage convolveAndSubtract( bool invert ///< Invert the output difference image ) { - boost::timer t; - t.restart(); + boost::timer::cpu_timer t; afwImage::MaskedImage convolvedMaskedImage(templateImage.getDimensions()); afwMath::ConvolutionControl convolutionControl = afwMath::ConvolutionControl(); @@ -140,7 +139,8 @@ afwImage::MaskedImage convolveAndSubtract( convolvedMaskedImage *= -1.0; } - double time = t.elapsed(); + t.stop(); + double time = 1e-9 * t.elapsed().wall; LOGL_DEBUG("TRACE4.ip.diffim.convolveAndSubtract", "Total compute time to convolve and subtract : %.2f s", time); @@ -171,8 +171,7 @@ afwImage::MaskedImage convolveAndSubtract( bool invert ///< Invert the output difference image ) { - boost::timer t; - t.restart(); + boost::timer::cpu_timer t; afwImage::MaskedImage convolvedMaskedImage(templateImage.getDimensions()); afwMath::ConvolutionControl convolutionControl = afwMath::ConvolutionControl(); @@ -193,7 +192,8 @@ afwImage::MaskedImage convolveAndSubtract( convolvedMaskedImage.getMask()->assign(*scienceMaskedImage.getMask()); convolvedMaskedImage.getVariance()->assign(*scienceMaskedImage.getVariance()); - double time = t.elapsed(); + t.stop(); + double time = 1e-9 * t.elapsed().wall; LOGL_DEBUG("TRACE4.ip.diffim.convolveAndSubtract", "Total compute time to convolve and subtract : %.2f s", time); diff --git a/src/KernelCandidate.cc b/src/KernelCandidate.cc index 839319aee..b520d90ae 100644 --- a/src/KernelCandidate.cc +++ b/src/KernelCandidate.cc @@ -9,7 +9,6 @@ * @ingroup ip_diffim */ #include -#include "boost/timer.hpp" #include "lsst/afw/math.h" #include "lsst/afw/image.h" diff --git a/src/KernelSolution.cc b/src/KernelSolution.cc index 26e4ce5d3..08d85edee 100644 --- a/src/KernelSolution.cc +++ b/src/KernelSolution.cc @@ -14,7 +14,7 @@ #include #include -#include "boost/timer.hpp" +#include "boost/timer/timer.hpp" #include "Eigen/Core" #include "Eigen/Cholesky" @@ -140,8 +140,7 @@ namespace diffim { Eigen::VectorXd aVec = Eigen::VectorXd::Zero(bVec.size()); - boost::timer t; - t.restart(); + boost::timer::cpu_timer t; LOGL_DEBUG("TRACE2.ip.diffim.KernelSolution.solve", "Solving for kernel"); @@ -177,7 +176,8 @@ namespace diffim { } } - double time = t.elapsed(); + t.stop(); + double time = 1e-9 * t.elapsed().wall; LOGL_DEBUG("TRACE3.ip.diffim.KernelSolution.solve", "Compute time for matrix math : %.2f s", time); @@ -322,8 +322,7 @@ namespace diffim { unsigned int endCol = goodBBox.getMaxX() + 1; unsigned int endRow = goodBBox.getMaxY() + 1; - boost::timer t; - t.restart(); + boost::timer::cpu_timer t; /* Eigen representation of input images; only the pixels that are unconvolved in cimage below */ Eigen::MatrixXd eigenTemplate = imageToEigenMatrix(templateImage).block(startRow, @@ -366,10 +365,10 @@ namespace diffim { } - double time = t.elapsed(); + t.stop(); + double time = 1e-9 * t.elapsed().wall; LOGL_DEBUG("TRACE3.ip.diffim.StaticKernelSolution.build", "Total compute time to do basis convolutions : %.2f s", time); - t.restart(); /* Load matrix with all values from convolvedEigenList : all images @@ -600,8 +599,7 @@ namespace diffim { } - boost::timer t; - t.restart(); + boost::timer::cpu_timer t; unsigned int const nKernelParameters = basisList.size(); unsigned int const nBackgroundParameters = this->_fitForBackground ? 1 : 0; @@ -638,10 +636,10 @@ namespace diffim { *eiter = eigenC; } - double time = t.elapsed(); + t.stop(); + double time = 1e-9 * t.elapsed().wall; LOGL_DEBUG("TRACE3.ip.diffim.StaticKernelSolution.buildWithMask", "Total compute time to do basis convolutions : %.2f s", time); - t.restart(); /* Load matrix with all convolved images */ Eigen::MatrixXd cMat(eigenTemplate.size(), nParameters); @@ -720,8 +718,7 @@ namespace diffim { endCol += 1; endRow += 1; - boost::timer t; - t.restart(); + boost::timer::cpu_timer t; /* Eigen representation of input images; only the pixels that are unconvolved in cimage below */ Eigen::MatrixXi eMask = maskToEigenMatrix(sMask).block(startRow, @@ -799,10 +796,10 @@ namespace diffim { *eiter = cMat; } - double time = t.elapsed(); + t.stop(); + double time = 1e-9 * t.elapsed().wall; LOGL_DEBUG("TRACE3.ip.diffim.StaticKernelSolution.build", "Total compute time to do basis convolutions : %.2f s", time); - t.restart(); /* Load matrix with all values from convolvedEigenList : all images @@ -973,8 +970,7 @@ namespace diffim { eigenScience.setZero(); eigeniVariance.setZero(); - boost::timer t; - t.restart(); + boost::timer::cpu_timer t; int nTerms = 0; typename std::vector::iterator biter = boxArray.begin(); @@ -1029,10 +1025,10 @@ namespace diffim { } - double time = t.elapsed(); + t.stop(); + double time = 1e-9 * t.elapsed().wall; LOGL_DEBUG("TRACE3.ip.diffim.MaskedKernelSolution.build", "Total compute time to do basis convolutions : %.2f s", time); - t.restart(); /* Load matrix with all values from convolvedEigenList : all images diff --git a/ups/ip_diffim.cfg b/ups/ip_diffim.cfg index 3456552df..09367a98e 100644 --- a/ups/ip_diffim.cfg +++ b/ups/ip_diffim.cfg @@ -4,7 +4,7 @@ import lsst.sconsUtils dependencies = { "required": ["meas_base", "afw", "numpy", "minuit2", "log", "daf_base"], - "buildRequired": ["pybind11"], + "buildRequired": ["boost_timer", "pybind11"], } config = lsst.sconsUtils.Configuration(