Skip to content

Commit

Permalink
Adapt to removal of pipe.base.task.Task.display().
Browse files Browse the repository at this point in the history
Directly invoke utility code from afwDisplay in LsstSimIsrTask rather than
relying on the pipe_base framework.
  • Loading branch information
jdswinbank committed Jan 6, 2016
1 parent 37fe777 commit c8a5049
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions python/lsst/obs/lsstSim/lsstSimIsrTask.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# LSST Data Management System
# Copyright 2008-2015 LSST Corporation.
# Copyright 2008-2016 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
Expand All @@ -19,6 +19,7 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
import lsst.afw.display as afwDisplay
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.ip.isr import IsrTask
Expand Down Expand Up @@ -52,6 +53,28 @@ def setDefaults(self):


class LsstSimIsrTask(IsrTask):
"""
\section obs_lsstSim_isr_Debug Debug variables
The \link lsst.pipe.base.cmdLineTask.CmdLineTask command line task\endlink interface supports a
flag \c --debug, \c -d to import \b debug.py from your \c PYTHONPATH; see <a
href="http://lsst-web.ncsa.illinois.edu/~buildbot/doxygen/x_masterDoxyDoc/base_debug.html">
Using lsstDebug to control debugging output</a> for more about \b debug.py files.
The available variables in LsstSimIsrTask are:
<DL>
<DT> \c display
<DD> A dictionary containing debug point names as keys with frame number as value. Valid keys are:
<DL>
<DT> snapExp0
<DD> Display ISR-corrected snap 0
<DT> snapExp1
<DD> Display ISR-corrected snap 1
<DT> postISRCCD
<DD> Display final exposure
</DL>
</DL>
"""
ConfigClass = LsstSimIsrConfig

def __init__(self, **kwargs):
Expand Down Expand Up @@ -113,7 +136,9 @@ def runDataRef(self, sensorRef):
if self.config.doWriteSnaps:
sensorRef.put(ccdExposure, "snapExp", snap=snapId)

self.display("snapExp%d" % (snapId,), exposure=ccdExposure)
snapName = "snapExp%d" % (snapId,)
if hasattr(self._display, "__contains__") and snapName in self._display:
afwDisplay.getDisplay(self._display[snapName]).mtv(ccdExposure)

if self.config.doSnapCombine:
loadSnapDict(snapDict, snapIdList=(0, 1), sensorRef=sensorRef)
Expand All @@ -126,7 +151,8 @@ def runDataRef(self, sensorRef):
if self.config.doWrite:
sensorRef.put(postIsrExposure, "postISRCCD")

self.display("postISRCCD", exposure=postIsrExposure)
if hasattr(self._display, "__contains__") and "postISRCCD" in self._display:
afwDisplay.getDisplay(self._display["postISRCCD"]).mtv(postIsrExposure)

return pipeBase.Struct(
exposure = postIsrExposure,
Expand Down

0 comments on commit c8a5049

Please sign in to comment.