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 `~lsst.meas.algorithms.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
.. code-block :: none
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.
Definition at line 61 of file repair.py.
def lsst.pipe.tasks.repair.RepairTask.run |
( |
|
self, |
|
|
|
exposure, |
|
|
|
defects = None , |
|
|
|
keepCRs = None |
|
) |
| |
Repair an Exposure's defects and cosmic rays.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure must have a valid Psf.
Modified in place.
defects : `lsst.meas.algorithms.DefectListT` or `None`, optional
If `None`, do no defect correction.
keepCRs : `Unknown` 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.
Definition at line 111 of file repair.py.