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 #151

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
7 changes: 4 additions & 3 deletions python/lsst/meas/astrom/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.utils.timer import timeMethod
from .ref_match import RefMatchTask, RefMatchConfig
from .fitTanSipWcs import FitTanSipWcsTask
from .display import displayAstrometry
Expand Down Expand Up @@ -128,7 +129,7 @@ def __init__(self, refObjLoader, schema=None, **kwargs):

self.makeSubtask("wcsFitter")

@pipeBase.timeMethod
@timeMethod
def run(self, sourceCat, exposure):
"""Load reference objects, match sources and optionally fit a WCS.

Expand Down Expand Up @@ -178,7 +179,7 @@ def run(self, sourceCat, exposure):
res = self.solve(exposure=exposure, sourceCat=sourceCat)
return res

@pipeBase.timeMethod
@timeMethod
def solve(self, exposure, sourceCat):
"""Load reference objects overlapping an exposure, match to sources and
fit a WCS
Expand Down Expand Up @@ -321,7 +322,7 @@ def solve(self, exposure, sourceCat):
matchMeta=matchMeta,
)

@pipeBase.timeMethod
@timeMethod
def _matchAndFitWcs(self, refCat, sourceCat, goodSourceCat, refFluxField, bbox, wcs, match_tolerance,
exposure=None):
"""Match sources to reference objects and fit a WCS.
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/meas/astrom/fitAffineWcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from lsst.geom import Point2D, degrees, arcseconds, radians
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.utils.timer import timeMethod

from .makeMatchStatistics import makeMatchStatisticsInRadians
from .setMatchDistance import setMatchDistance
Expand Down Expand Up @@ -101,7 +102,7 @@ class FitAffineWcsTask(pipeBase.Task):
ConfigClass = FitAffineWcsConfig
_DefaultName = "fitAffineWcs"

@pipeBase.timeMethod
@timeMethod
def fitWcs(self,
matches,
initWcs,
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/meas/astrom/fitSipDistortion.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import lsst.afw.image
import lsst.afw.geom
import lsst.afw.display
from lsst.utils.timer import timeMethod

from .scaledPolynomialTransformFitter import ScaledPolynomialTransformFitter, OutlierRejectionControl
from .sipTransform import SipForwardTransform, SipReverseTransform, makeWcs
Expand Down Expand Up @@ -111,7 +112,7 @@ def __init__(self, **kwargs):
self.outlierRejectionCtrl.nClipMax = self.config.nClipMax
self.outlierRejectionCtrl.nSigma = self.config.rejSigma

@lsst.pipe.base.timeMethod
@timeMethod
def fitWcs(self, matches, initWcs, bbox=None, refCat=None, sourceCat=None, exposure=None):
"""Fit a TAN-SIP WCS from a list of reference object/source matches.

Expand Down
3 changes: 2 additions & 1 deletion python/lsst/meas/astrom/fitTanSipWcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import lsst.afw.table as afwTable
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.utils.timer import timeMethod
from .setMatchDistance import setMatchDistance
from .sip import makeCreateWcsWithSip

Expand Down Expand Up @@ -76,7 +77,7 @@ class FitTanSipWcsTask(pipeBase.Task):
ConfigClass = FitTanSipWcsConfig
_DefaultName = "fitWcs"

@pipeBase.timeMethod
@timeMethod
def fitWcs(self, matches, initWcs, bbox=None, refCat=None, sourceCat=None, exposure=None):
"""Fit a TAN-SIP WCS from a list of reference object/source matches

Expand Down
5 changes: 3 additions & 2 deletions python/lsst/meas/astrom/matchOptimisticBTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.utils.timer import timeMethod

from .setMatchDistance import setMatchDistance
from .matchOptimisticB import matchOptimisticB, MatchOptimisticBControl
Expand Down Expand Up @@ -126,7 +127,7 @@ def filterStars(self, refCat):
"""
return refCat

@pipeBase.timeMethod
@timeMethod
def matchObjectsToSources(self, refCat, sourceCat, wcs, sourceFluxField, refFluxField,
match_tolerance=None):
"""Match sources to position reference stars.
Expand Down Expand Up @@ -257,7 +258,7 @@ class that used to be part of this class.
and not source.get(self.interpolatedCenterKey)
and not source.get(self.saturatedKey))

@pipeBase.timeMethod
@timeMethod
def _doMatch(self, refCat, sourceCat, wcs, refFluxField, numUsableSources, minMatchedPairs,
maxMatchDist, sourceFluxField, verbose):
"""Implementation of matching sources to position reference stars.
Expand Down
5 changes: 3 additions & 2 deletions python/lsst/meas/astrom/matchPessimisticB.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lsst.pipe.base as pipeBase
import lsst.geom as geom
import lsst.afw.table as afwTable
from lsst.utils.timer import timeMethod

from .matchOptimisticBTask import MatchTolerance

Expand Down Expand Up @@ -184,7 +185,7 @@ class MatchPessimisticBTask(pipeBase.Task):
def __init__(self, **kwargs):
pipeBase.Task.__init__(self, **kwargs)

@pipeBase.timeMethod
@timeMethod
def matchObjectsToSources(self, refCat, sourceCat, wcs, sourceFluxField, refFluxField,
match_tolerance=None):
"""Match sources to position reference stars
Expand Down Expand Up @@ -314,7 +315,7 @@ def _filterRefCat(self, refCat, refFluxField):

return outCat

@pipeBase.timeMethod
@timeMethod
def _doMatch(self, refCat, sourceCat, wcs, refFluxField, numUsableSources,
minMatchedPairs, match_tolerance, sourceFluxField, verbose):
"""Implementation of matching sources to position reference objects
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/meas/astrom/ref_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import lsst.pipe.base as pipeBase
from lsst.meas.algorithms import ReferenceSourceSelectorTask
from lsst.meas.algorithms.sourceSelector import sourceSelectorRegistry
from lsst.utils.timer import timeMethod
from .matchPessimisticB import MatchPessimisticBTask
from .display import displayAstrometry
from . import makeMatchStatistics
Expand Down Expand Up @@ -112,7 +113,7 @@ def setRefObjLoader(self, refObjLoader):
"""
self.refObjLoader = refObjLoader

@pipeBase.timeMethod
@timeMethod
def loadAndMatch(self, exposure, sourceCat):
"""Load reference objects overlapping an exposure and match to sources
detected on that exposure.
Expand Down