LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Apply common instrument signature correction algorithms to a raw frame. More...
Public Member Functions | |
def | __init__ |
Constructor for IsrTask. More... | |
def | readIsrData |
Retrieve necessary frames for instrument signature removal. More... | |
def | run |
Perform instrument signature removal on an exposure. More... | |
def | runDataRef |
Perform instrument signature removal on a ButlerDataRef of a Sensor. More... | |
def | convertIntToFloat |
def | biasCorrection |
Apply bias correction in place. More... | |
def | darkCorrection |
Apply dark correction in place. More... | |
def | updateVariance |
Set the variance plane based on the image plane, plus amplifier gain and read noise. More... | |
def | flatCorrection |
Apply flat correction in place. More... | |
def | getIsrExposure |
Retrieve a calibration dataset for removing instrument signature. More... | |
def | saturationDetection |
Detect saturated pixels and mask them using mask plane "SAT", in place. More... | |
def | saturationInterpolation |
Interpolate over saturated pixels, in place. More... | |
def | maskAndInterpDefect |
Mask defects using mask plane "BAD" and interpolate over them, in place. More... | |
def | maskAndInterpNan |
Mask NaNs using mask plane "UNMASKEDNAN" and interpolate over them, in place. More... | |
def | overscanCorrection |
Apply overscan correction, in place. More... | |
Static Public Attributes | |
ConfigClass = IsrTaskConfig | |
Static Private Attributes | |
string | _DefaultName = "isr" |
Apply common instrument signature correction algorithms to a raw frame.
The process for correcting imaging data is very similar from camera to camera. This task provides a vanilla implementation of doing these corrections, including the ability to turn certain corrections off if they are not needed. The inputs to the primary method, run, are a raw exposure to be corrected and the calibration data products. The raw input is a single chip sized mosaic of all amps including overscans and other non-science pixels. The method runDataRef() is intended for use by a lsst.pipe.base.cmdLineTask.CmdLineTask and takes as input only a daf.persistence.butlerSubset.ButlerDataRef. This task may not meet all needs and it is expected that it will be subclassed for specific applications.
Constructor for IsrTask.
[in] | *args | – a list of positional arguments passed on to the Task constructor |
[in] | **kwargs | – a dictionary of keyword arguments passed on to the Task constructor Call the lsst.pipe.base.task.Task.__init__ method Then setup the assembly and fringe correction subtasks |
Perform instrument signature removal on an exposure. Steps include:
[in] | ccdExposure | – lsst.afw.image.exposure of detector data |
[in] | bias | – exposure of bias frame |
[in] | dark | – exposure of dark frame |
[in] | flat | – exposure of flatfield |
[in] | defects | – list of detects |
[in] | fringes | – exposure of fringe frame or list of fringe exposure |
See IsrTaskConfig
The command line task interface supports a flag –debug
, -d
to import debug.py from your PYTHONPATH
; see Using lsstDebug to control debugging output for more about debug.py files.
The available variables in IsrTask are:
display
For example, put something like
into your debug.py file and run the commandline task with the –debug
flag.
This code is in runIsrTask.py in the examples directory and can be run as e.g.
Stepping through the example:
Import the task. There are other imports. Read the source file for more info.Create the raw input data with the help of some utilities in exampleUtils.py also in the examples directory. We will only do overscan, dark and flat correction. The data are constructed by hand so that all effects will be corrected for essentially perfectly.
Finally, run the exposures through ISR.
Definition at line 176 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.__init__ | ( | self, | |
args, | |||
kwargs | |||
) |
Constructor for IsrTask.
[in] | *args | – a list of positional arguments passed on to the Task constructor |
[in] | **kwargs | – a dictionary of keyword arguments passed on to the Task constructor Call the lsst.pipe.base.task.Task.__init__ method Then setup the assembly and fringe correction subtasks |
Definition at line 317 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.biasCorrection | ( | self, | |
exposure, | |||
biasExposure | |||
) |
Apply bias correction in place.
[in,out] | exposure | exposure to process |
[in] | biasExposure | bias exposure of same size as exposure |
Definition at line 485 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.convertIntToFloat | ( | self, | |
exposure | |||
) |
Convert an exposure from uint16 to float, set variance plane to 1 and mask plane to 0
Definition at line 468 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.darkCorrection | ( | self, | |
exposure, | |||
darkExposure | |||
) |
Apply dark correction in place.
[in,out] | exposure | exposure to process |
[in] | darkExposure | dark exposure of same size as exposure |
Definition at line 493 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.flatCorrection | ( | self, | |
exposure, | |||
flatExposure | |||
) |
Apply flat correction in place.
[in,out] | exposure | exposure to process |
[in] | flatExposure | flatfield exposure same size as exposure |
Definition at line 520 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.getIsrExposure | ( | self, | |
dataRef, | |||
datasetType, | |||
immediate = True |
|||
) |
Retrieve a calibration dataset for removing instrument signature.
[in] | dataRef | data reference for exposure |
[in] | datasetType | type of dataset to retrieve (e.g. 'bias', 'flat') |
[in] | immediate | if True, disable butler proxies to enable error handling within this routine |
Definition at line 533 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.maskAndInterpDefect | ( | self, | |
ccdExposure, | |||
defectBaseList | |||
) |
Mask defects using mask plane "BAD" and interpolate over them, in place.
[in,out] | ccdExposure | exposure to process |
[in] | defectBaseList | a list of defects to mask and interpolate |
Definition at line 582 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.maskAndInterpNan | ( | self, | |
exposure | |||
) |
Mask NaNs using mask plane "UNMASKEDNAN" and interpolate over them, in place.
We mask and interpolate over all NaNs, including those that are masked with other bits (because those may or may not be interpolated over later, and we want to remove all NaNs). Despite this behaviour, the "UNMASKEDNAN" mask plane is used to preserve the historical name.
[in,out] | exposure | exposure to process |
Definition at line 603 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.overscanCorrection | ( | self, | |
exposure, | |||
amp | |||
) |
Apply overscan correction, in place.
[in,out] | exposure | exposure to process; must include both DataSec and BiasSec pixels |
[in] | amp | amplifier device data |
Definition at line 636 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.readIsrData | ( | self, | |
dataRef | |||
) |
Retrieve necessary frames for instrument signature removal.
[in] | dataRef | – a daf.persistence.butlerSubset.ButlerDataRef of the detector data to be processed |
Definition at line 329 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.run | ( | self, | |
ccdExposure, | |||
bias = None , |
|||
dark = None , |
|||
flat = None , |
|||
defects = None , |
|||
fringes = None |
|||
) |
Perform instrument signature removal on an exposure.
Steps include:
[in] | ccdExposure | – lsst.afw.image.exposure of detector data |
[in] | bias | – exposure of bias frame |
[in] | dark | – exposure of dark frame |
[in] | flat | – exposure of flatfield |
[in] | defects | – list of detects |
[in] | fringes | – exposure of fringe frame or list of fringe exposure |
Definition at line 361 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.runDataRef | ( | self, | |
sensorRef | |||
) |
Perform instrument signature removal on a ButlerDataRef of a Sensor.
[in] | sensorRef | – daf.persistence.butlerSubset.ButlerDataRef of the detector data to be processed |
Definition at line 445 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.saturationDetection | ( | self, | |
exposure, | |||
amp | |||
) |
Detect saturated pixels and mask them using mask plane "SAT", in place.
[in,out] | exposure | exposure to process; only the amp DataSec is processed |
[in] | amp | amplifier device data |
Definition at line 550 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.saturationInterpolation | ( | self, | |
ccdExposure | |||
) |
Interpolate over saturated pixels, in place.
[in,out] | ccdExposure | exposure to process |
Definition at line 566 of file isrTask.py.
def lsst.ip.isr.isrTask.IsrTask.updateVariance | ( | self, | |
ampExposure, | |||
amp | |||
) |
Set the variance plane based on the image plane, plus amplifier gain and read noise.
[in,out] | ampExposure | exposure to process |
[in] | amp | amplifier detector information |
Definition at line 507 of file isrTask.py.
|
staticprivate |
Definition at line 315 of file isrTask.py.
|
static |
Definition at line 314 of file isrTask.py.