Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-6519

Temp local background broken

    Details

    • Story Points:
      0.5
    • Epic Link:
    • Sprint:
      DRP F16-1
    • Team:
      Data Release Production

      Description

      The temp local background feature has been broken and needs to be fixed.

        Attachments

          Activity

          Hide
          price Paul Price added a comment -

          John Parejko, would you mind reviewing these itty-bitty changes? I found a bug in pipe_tasks as well and included it here.

          price@price-laptop:~/LSST/meas/algorithms (tickets/DM-6519=) $ git sub-patch
          commit 02e19361633e4bd2187f9d775ff2dc1946b663b8
          Author: Paul Price <price@astro.princeton.edu>
          Date:   Thu Jun 9 17:23:18 2016 -0400
           
              detection: fix temp local background
              
              Appears to have been broken in the background refactoring.
           
          diff --git a/python/lsst/meas/algorithms/detection.py b/python/lsst/meas/algorithms/detection.py
          index 28a2e3b..d7f850f 100644
          --- a/python/lsst/meas/algorithms/detection.py
          +++ b/python/lsst/meas/algorithms/detection.py
          @@ -241,6 +241,8 @@ into your debug.py file and run measAlgTasks.py with the \c --debug flag.
                       self.negativeFlagKey = None
                   if self.config.reEstimateBackground:
                       self.makeSubtask("background")
          +        if self.config.doTempLocalBackground:
          +            self.makeSubtask("tempLocalBackground")
           
               @pipeBase.timeMethod
               def run(self, table, exposure, doSmooth=True, sigma=None, clearMask=True):
          @@ -326,7 +328,7 @@ into your debug.py file and run measAlgTasks.py with the \c --debug flag.
                       del mask
           
                   if self.config.doTempLocalBackground:
          -            tempBgRes = self.tempLocalBackground.run(maskedImage)
          +            tempBgRes = self.tempLocalBackground.run(exposure)
                       tempLocalBkgdImage = tempBgRes.background.getImage()
           
                   if sigma is None:
           
           
          price@price-laptop:~/LSST/pipe/tasks (tickets/DM-6519=) $ git sub-patch
          commit 419c53b1f1d862841f271f3576e7ebcc98da6de2
          Author: Paul Price <price@astro.princeton.edu>
          Date:   Thu Jun 9 17:39:11 2016 -0400
           
              calibrate: don't create match metadata unless doing astrometry
              
              Because it can't be created if there's no Wcs.
           
          diff --git a/python/lsst/pipe/tasks/calibrate.py b/python/lsst/pipe/tasks/calibrate.py
          index 33fca6e..02951da 100644
          --- a/python/lsst/pipe/tasks/calibrate.py
          +++ b/python/lsst/pipe/tasks/calibrate.py
          @@ -324,8 +324,10 @@ class CalibrateTask(pipeBase.CmdLineTask):
                   elif exposure is None:
                       raise RuntimeError("doUnpersist false; exposure must be provided")
           
          -        if self.config.doWrite:
          +        if self.config.doWrite and self.config.doAstrometry:
                       matchMeta = createMatchMetadata(exposure, border=self.config.refObjLoader.pixelMargin)
          +        else:
          +            matchMeta = None
           
                   exposureIdInfo = dataRef.get("expIdInfo")
           
          

          Show
          price Paul Price added a comment - John Parejko , would you mind reviewing these itty-bitty changes? I found a bug in pipe_tasks as well and included it here. price@price-laptop:~/LSST/meas/algorithms (tickets/DM-6519=) $ git sub-patch commit 02e19361633e4bd2187f9d775ff2dc1946b663b8 Author: Paul Price <price@astro.princeton.edu> Date: Thu Jun 9 17:23:18 2016 -0400   detection: fix temp local background Appears to have been broken in the background refactoring.   diff --git a/python/lsst/meas/algorithms/detection.py b/python/lsst/meas/algorithms/detection.py index 28a2e3b..d7f850f 100644 --- a/python/lsst/meas/algorithms/detection.py +++ b/python/lsst/meas/algorithms/detection.py @@ -241,6 +241,8 @@ into your debug.py file and run measAlgTasks.py with the \c --debug flag. self.negativeFlagKey = None if self.config.reEstimateBackground: self.makeSubtask("background") + if self.config.doTempLocalBackground: + self.makeSubtask("tempLocalBackground") @pipeBase.timeMethod def run(self, table, exposure, doSmooth=True, sigma=None, clearMask=True): @@ -326,7 +328,7 @@ into your debug.py file and run measAlgTasks.py with the \c --debug flag. del mask if self.config.doTempLocalBackground: - tempBgRes = self.tempLocalBackground.run(maskedImage) + tempBgRes = self.tempLocalBackground.run(exposure) tempLocalBkgdImage = tempBgRes.background.getImage() if sigma is None:     price@price-laptop:~/LSST/pipe/tasks (tickets/DM-6519=) $ git sub-patch commit 419c53b1f1d862841f271f3576e7ebcc98da6de2 Author: Paul Price <price@astro.princeton.edu> Date: Thu Jun 9 17:39:11 2016 -0400   calibrate: don't create match metadata unless doing astrometry Because it can't be created if there's no Wcs.   diff --git a/python/lsst/pipe/tasks/calibrate.py b/python/lsst/pipe/tasks/calibrate.py index 33fca6e..02951da 100644 --- a/python/lsst/pipe/tasks/calibrate.py +++ b/python/lsst/pipe/tasks/calibrate.py @@ -324,8 +324,10 @@ class CalibrateTask(pipeBase.CmdLineTask): elif exposure is None: raise RuntimeError("doUnpersist false; exposure must be provided") - if self.config.doWrite: + if self.config.doWrite and self.config.doAstrometry: matchMeta = createMatchMetadata(exposure, border=self.config.refObjLoader.pixelMargin) + else: + matchMeta = None exposureIdInfo = dataRef.get("expIdInfo")
          Hide
          price Paul Price added a comment -

          Here's another itty-bitty commit, in meas_astrom:

          price@price-laptop:~/LSST/meas/astrom (tickets/DM-6519=) $ git sub-patch
          commit daed6828090f8fcb4c10afef9d143e2e03f8a3be
          Author: Paul Price <price@astro.princeton.edu>
          Date:   Fri Jun 10 16:06:36 2016 -0400
           
              fitTanSipWcs: fix log usage
              
              Had "log.warning" instead of "log.warn".
           
          diff --git a/python/lsst/meas/astrom/fitTanSipWcs.py b/python/lsst/meas/astrom/fitTanSipWcs.py
          index 3133de2..f858b8d 100644
          --- a/python/lsst/meas/astrom/fitTanSipWcs.py
          +++ b/python/lsst/meas/astrom/fitTanSipWcs.py
          @@ -156,14 +156,14 @@ class FitTanSipWcsTask(pipeBase.Task):
                       self.log.logdebug("Updating centroids in refCat")
                       self.updateRefCentroids(wcs, refList=refCat)
                   else:
          -            self.log.warning("Updating reference object centroids in match list; refCat is None")
          +            self.log.warn("Updating reference object centroids in match list; refCat is None")
                       self.updateRefCentroids(wcs, refList=[match.first for match in matches])
           
                   if sourceCat is not None:
                       self.log.logdebug("Updating coords in sourceCat")
                       self.updateSourceCoords(wcs, sourceList=sourceCat)
                   else:
          -            self.log.warning("Updating source coords in match list; sourceCat is None")
          +            self.log.warn("Updating source coords in match list; sourceCat is None")
                       self.updateSourceCoords(wcs, sourceList=[match.second for match in matches])
           
                   self.log.logdebug("Updating distance in match list")
          

          Show
          price Paul Price added a comment - Here's another itty-bitty commit, in meas_astrom: price@price-laptop:~/LSST/meas/astrom (tickets/DM-6519=) $ git sub-patch commit daed6828090f8fcb4c10afef9d143e2e03f8a3be Author: Paul Price <price@astro.princeton.edu> Date: Fri Jun 10 16:06:36 2016 -0400   fitTanSipWcs: fix log usage Had "log.warning" instead of "log.warn".   diff --git a/python/lsst/meas/astrom/fitTanSipWcs.py b/python/lsst/meas/astrom/fitTanSipWcs.py index 3133de2..f858b8d 100644 --- a/python/lsst/meas/astrom/fitTanSipWcs.py +++ b/python/lsst/meas/astrom/fitTanSipWcs.py @@ -156,14 +156,14 @@ class FitTanSipWcsTask(pipeBase.Task): self.log.logdebug("Updating centroids in refCat") self.updateRefCentroids(wcs, refList=refCat) else: - self.log.warning("Updating reference object centroids in match list; refCat is None") + self.log.warn("Updating reference object centroids in match list; refCat is None") self.updateRefCentroids(wcs, refList=[match.first for match in matches]) if sourceCat is not None: self.log.logdebug("Updating coords in sourceCat") self.updateSourceCoords(wcs, sourceList=sourceCat) else: - self.log.warning("Updating source coords in match list; sourceCat is None") + self.log.warn("Updating source coords in match list; sourceCat is None") self.updateSourceCoords(wcs, sourceList=[match.second for match in matches]) self.log.logdebug("Updating distance in match list")
          Hide
          Parejkoj John Parejko added a comment -

          My only question is whether matchMeta = None addition in calibrate.py would break anything further down the line. Otherwise this looks fine.

          Show
          Parejkoj John Parejko added a comment - My only question is whether matchMeta = None addition in calibrate.py would break anything further down the line. Otherwise this looks fine.
          Hide
          Parejkoj John Parejko added a comment -

          See comment above.

          Show
          Parejkoj John Parejko added a comment - See comment above.
          Hide
          price Paul Price added a comment -

          Thanks John Parejko. If downstream processing can't handle matchMeta = None but isn't guarded by a check on doAstrometry, then that's a bug that we'll have to fix. However, we have run this on UKIRT data (DM-6496) and it appears to work fine. I'll merge these to master.

          Show
          price Paul Price added a comment - Thanks John Parejko . If downstream processing can't handle matchMeta = None but isn't guarded by a check on doAstrometry , then that's a bug that we'll have to fix. However, we have run this on UKIRT data ( DM-6496 ) and it appears to work fine. I'll merge these to master.
          Hide
          price Paul Price added a comment -

          Merged to master.

          Show
          price Paul Price added a comment - Merged to master.
          Hide
          swinbank John Swinbank added a comment -
          Show
          swinbank John Swinbank added a comment - Added a note to the WIP release notes ( https://confluence.lsstcorp.org/display/DM/Data+Release+Production+WIP+F16+Release+Notes ).

            People

            • Assignee:
              price Paul Price
              Reporter:
              price Paul Price
              Reviewers:
              John Parejko
              Watchers:
              John Parejko, John Swinbank, Paul Price
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: