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-32226: Replace pipe.base.timeMethod with utils.timer #200

Merged
merged 1 commit into from
Oct 20, 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
3 changes: 2 additions & 1 deletion python/lsst/ip/diffim/dipoleFitTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
from lsst.log import Log
import lsst.pex.exceptions as pexExcept
import lsst.pex.config as pexConfig
from lsst.pipe.base import Struct, timeMethod
from lsst.pipe.base import Struct
from lsst.utils.timer import timeMethod

__all__ = ("DipoleFitTask", "DipoleFitPlugin", "DipoleFitTaskConfig", "DipoleFitPluginConfig",
"DipoleFitAlgorithm")
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/ip/diffim/imageDecorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import lsst.meas.algorithms as measAlg
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase

from lsst.utils.timer import timeMethod

from .imageMapReduce import (ImageMapReduceConfig, ImageMapReduceTask,
ImageMapper)
Expand Down Expand Up @@ -114,7 +114,7 @@ def computeVarianceMean(self, exposure):
var = statObj.getValue(afwMath.MEANCLIP)
return var

@pipeBase.timeMethod
@timeMethod
def run(self, scienceExposure, templateExposure, subtractedExposure, psfMatchingKernel,
preConvKernel=None, xcen=None, ycen=None, svar=None, tvar=None,
templateMatched=True, preConvMode=False, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/ip/diffim/imageMapReduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import lsst.meas.algorithms as measAlg
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.utils.timer import timeMethod

__all__ = ("ImageMapReduceTask", "ImageMapReduceConfig",
"ImageMapper", "ImageMapperConfig",
Expand Down Expand Up @@ -523,7 +524,7 @@ def __init__(self, *args, **kwargs):
self.makeSubtask("mapper")
self.makeSubtask("reducer")

@pipeBase.timeMethod
@timeMethod
def run(self, exposure, **kwargs):
"""Perform a map-reduce operation on the given exposure.

Expand Down
9 changes: 5 additions & 4 deletions python/lsst/ip/diffim/imagePsfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from . import diffimLib
from . import diffimTools
import lsst.afw.display as afwDisplay
from lsst.utils.timer import timeMethod

__all__ = ["ImagePsfMatchConfig", "ImagePsfMatchTask", "subtractAlgorithmRegistry"]

Expand Down Expand Up @@ -336,7 +337,7 @@ def getFwhmPix(self, psf):
sigPix = psf.computeShape().getDeterminantRadius()
return sigPix*sigma2fwhm

@pipeBase.timeMethod
@timeMethod
def matchExposures(self, templateExposure, scienceExposure,
templateFwhmPix=None, scienceFwhmPix=None,
candidateList=None, doWarping=True, convolveTemplate=True):
Expand Down Expand Up @@ -454,7 +455,7 @@ def matchExposures(self, templateExposure, scienceExposure,
results.matchedExposure = psfMatchedExposure
return results

@pipeBase.timeMethod
@timeMethod
def matchMaskedImages(self, templateMaskedImage, scienceMaskedImage, candidateList,
templateFwhmPix=None, scienceFwhmPix=None):
"""PSF-match a MaskedImage (templateMaskedImage) to a reference MaskedImage (scienceMaskedImage).
Expand Down Expand Up @@ -567,7 +568,7 @@ def matchMaskedImages(self, templateMaskedImage, scienceMaskedImage, candidateLi
kernelCellSet=kernelCellSet,
)

@pipeBase.timeMethod
@timeMethod
def subtractExposures(self, templateExposure, scienceExposure,
templateFwhmPix=None, scienceFwhmPix=None,
candidateList=None, doWarping=True, convolveTemplate=True):
Expand Down Expand Up @@ -685,7 +686,7 @@ def subtractExposures(self, templateExposure, scienceExposure,
results.subtractedExposure = subtractedExposure
return results

@pipeBase.timeMethod
@timeMethod
def subtractMaskedImages(self, templateMaskedImage, scienceMaskedImage, candidateList,
templateFwhmPix=None, scienceFwhmPix=None):
"""Psf-match and subtract two MaskedImages.
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/ip/diffim/modelPsfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import lsst.log as log
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.utils.timer import timeMethod
from .makeKernelBasisList import makeKernelBasisList
from .psfMatch import PsfMatchTask, PsfMatchConfigAL
from . import utils as dituils
Expand Down Expand Up @@ -295,7 +296,7 @@ def __init__(self, *args, **kwargs):
PsfMatchTask.__init__(self, *args, **kwargs)
self.kConfig = self.config.kernel.active

@pipeBase.timeMethod
@timeMethod
def run(self, exposure, referencePsfModel, kernelSum=1.0):
"""Psf-match an exposure to a model Psf

Expand Down
3 changes: 2 additions & 1 deletion python/lsst/ip/diffim/psfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import lsst.log as log
import lsst.pipe.base as pipeBase
from lsst.meas.algorithms import SubtractBackgroundConfig
from lsst.utils.timer import timeMethod
from . import utils as diutils
from . import diffimLib

Expand Down Expand Up @@ -874,7 +875,7 @@ def _buildCellSet(self, *args):
override in derived classes"""
return

@pipeBase.timeMethod
@timeMethod
def _solve(self, kernelCellSet, basisList, returnOnExcept=False):
"""Solve for the PSF matching kernel

Expand Down