lsstDebug is a tool to help with live debugging of Science Pipelines packages. Many Tasks are configured to show debugging information when certain parameters are set in lsstDebug, for example display might show some Task-specific images and plots.


lsstDebug is developed at You can find Jira issues for this module under the base component.

Using lsstDebug to control debugging output

The lsstDebug module is used to turn on debugging output and plots without changing the code being executed. For example, the variable lsstDebug.Info("lsst.meas.astrom.astrometry").debug is used to control debugging output from the lsst.meas.astrom.astrometry module.

You may interrogate lsstDebug for any string in sys.modules, i.e. for the __name__ of any package that has been imported; for example, if the lsst.meas.algorithms package is loaded then lsstDebug.Info("lsst.meas.algorithms").parameter will return False unless parameter has been set to True elsewhere.

The convention is that the name (e.g. lsst.meas.astrom.astrometry) is the __name__ of the module, so that in you can check whether display was set like this:

import lsstDebug


which will print False unless lsstDebug.Info(__name__).display has somehow been set to True.

You can use this to turn on debug parameters in specific packages, by creating a file that is available in the PYTHONPATH:

import lsstDebug

def DebugInfo(name):
    di = lsstDebug.getInfo(name)  # N.b. lsstDebug.Info(name) would call us recursively
    if name == "debugExample":
        di.display = True

    return di

lsstDebug.Info = DebugInfo

Then, if you have a module like this:

import lsstDebug

print("display is", lsstDebug.Info(__name__).display)

Running without importing will result in display==False:

$ python -c "import foo"
display is False

while importing will show:

$ python -c "import debug; import foo"
display is True

The pipetask run command line interface supports a flag --debug to import from your PYTHONPATH.

Python API reference

lsstDebug Module


getDebugFrame(debugDisplay, name)

Attempt to extract a frame for displaying a product called name from the debugDisplay variable.



An object cognisant of debugging parameters appropriate for module modname.