RepairTask#

class lsst.pipe.tasks.repair.RepairTask(**kwargs)#

Bases: Task

Repair an exposures defects and cosmic rays via interpolation.

This task operates on an lsst.afw.image.Exposure in place to interpolate over a set of Defect objects.

It will also, optionally, find and interpolate any cosmic rays in the lsst.afw.image.Exposure.

Notes#

Debugging: The available debug variables in RepairTask are:

display :

A dictionary containing debug point names as keys with frame number as value. Valid keys are:

repair.before :

display image before any repair is done

repair.after :

display image after cosmic ray and defect correction

displayCR :

If True, display the exposure on ds9’s frame 1 and overlay bounding boxes around detects CRs.

To investigate the pipe_tasks_repair_Debug, put something like

import lsstDebug
def DebugInfo(name):
    di = lsstDebug.getInfo(name)        # N.b. lsstDebug.Info(name) would call us recursively
    if name == "lsst.pipe.tasks.repair":
        di.display = {'repair.before':2, 'repair.after':3}
        di.displayCR = True
    return di

lsstDebug.Info = DebugInfo into your debug.py file and run runRepair.py with the –debug flag.

Conversion notes:

Display code should be updated once we settle on a standard way of controlling what is displayed.

Methods Summary

cosmicRay(exposure[, keepCRs])

Mask cosmic rays.

run(exposure[, defects, keepCRs])

Repair an Exposure's defects and cosmic rays.

Methods Documentation

cosmicRay(exposure, keepCRs=None)#

Mask cosmic rays.

Parameters#

exposurelsst.afw.image.Exposure

Exposure to process.

keepCRsUnknown or None, optional

Don’t interpolate over the CR pixels (defer to pex_config if None).

run(exposure, defects=None, keepCRs=None)#

Repair an Exposure’s defects and cosmic rays.

Parameters#

exposurelsst.afw.image.Exposure

Exposure must have a valid Psf. Modified in place.

defectslsst.meas.algorithms.DefectListT or None, optional

If None, do no defect correction.

keepCRsUnknown or None, optional

Don’t interpolate over the CR pixels (defer to RepairConfig if None).

Raises#

AssertionError

Raised if any of the following occur: - No exposure provided. - The object provided as exposure evaluates to False. - No PSF provided. - The Exposure has no associated Psf.