|
lsst.ip.isr gbffcd5fa91+e53b91de25
|
Public Member Functions | |
| __init__ (self, **kwargs) | |
| runQuantum (self, butlerQC, inputRefs, outputRefs) | |
| validateInput (self, inputs) | |
| diffNonLinearCorrection (self, ccdExposure, dnlLUT, **kwargs) | |
| maskFullAmplifiers (self, ccdExposure, detector, defects, gains=None) | |
| checkAllBadAmps (self, badAmpDict, detector) | |
| checkAmpOverscanLevel (self, badAmpDict, exposure, ptc) | |
| checkAmpNoise (self, badAmpDict, exposure, ptc) | |
| maskSaturatedPixels (self, badAmpDict, ccdExposure, detector, detectorConfig, ptc=None) | |
| maskITLSatEdgesAndColumns (self, exposure, badAmpDict) | |
| overscanCorrection (self, mode, detectorConfig, detector, badAmpDict, ccdExposure) | |
| maskNegativeVariance (self, exposure) | |
| addVariancePlane (self, exposure, detector) | |
| maskDefects (self, exposure, defectBaseList) | |
| maskEdges (self, exposure, numEdgePixels=0, maskPlane="SUSPECT", level='DETECTOR') | |
| maskNan (self, exposure) | |
| setBadRegions (self, exposure) | |
| flatContext (self, exp, flat, dark=None) | |
| getBrighterFatterKernel (self, detector, bfKernel) | |
| applyElectrostaticBrighterFatterCorrection (self, ccdExposure, flat, dark, electroBfDistortionMatrix, brighterFatterApplyGain, bfGains) | |
| applyFluxConservingBrighterFatterCorrection (self, ccdExposure, flat, dark, bfKernel, brighterFatterApplyGain, bfGains) | |
| applyBrighterFatterCorrection (self, ccdExposure, flat, dark, bfKernel, brighterFatterApplyGain, bfGains) | |
| darkCorrection (self, exposure, darkExposure, invert=False) | |
| compareUnits (self, calibMetadata, calibName) | |
| convertIntToFloat (self, exposure) | |
| ditherCounts (self, exposure, detectorConfig, fallbackSeed=12345) | |
| checkBssVoltage (self, exposure) | |
| makeBinnedImages (self, exposure) | |
| run (self, ccdExposure, *, dnlLUT=None, bias=None, deferredChargeCalib=None, linearizer=None, ptc=None, gainCorrection=None, crosstalk=None, defects=None, bfKernel=None, electroBfDistortionMatrix=None, dark=None, flat=None, camera=None) | |
Static Public Member Functions | |
| extractCalibDate (calib) | |
Static Public Attributes | |
| ConfigClass = IsrTaskLSSTConfig | |
Static Protected Attributes | |
| str | _DefaultName = "isrLSST" |
Definition at line 735 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.__init__ | ( | self, | |
| ** | kwargs ) |
Definition at line 739 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.addVariancePlane | ( | self, | |
| exposure, | |||
| detector ) |
Add the variance plane to the image.
The gain and read noise per amp must have been set in the
exposure metadata as ``LSST ISR GAIN ampName`` and
``LSST ISR READNOISE ampName`` with the units of the image.
Unit conversions for the variance plane will be done as
necessary based on the exposure units.
The units of the variance plane will always be of the same
type as the units of the input image itself
(``LSST ISR UNITS``^2).
Parameters
----------
exposure : `lsst.afw.image.Exposure`
The exposure to add the variance plane.
detector : `lsst.afw.cameraGeom.Detector`
Detector with geometry info.
Definition at line 1320 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.applyBrighterFatterCorrection | ( | self, | |
| ccdExposure, | |||
| flat, | |||
| dark, | |||
| bfKernel, | |||
| brighterFatterApplyGain, | |||
| bfGains ) |
Apply a brighter fatter correction to the image using the
method defined in Coulton et al. 2019.
Note that this correction requires that the image is in units
electrons.
Parameters
----------
ccdExposure : `lsst.afw.image.Exposure`
Exposure to process.
flat : `lsst.afw.image.Exposure`
Flat exposure the same size as ``exp``.
dark : `lsst.afw.image.Exposure`, optional
Dark exposure the same size as ``exp``.
bfKernel : `lsst.ip.isr.BrighterFatterKernel`
The brighter-fatter kernel.
brighterFatterApplyGain : `bool`
Apply the gain to convert the image to electrons?
bfGains : `dict`
The gains to use if brighterFatterApplyGain = True.
Yields
------
exp : `lsst.afw.image.Exposure`
The flat and dark corrected exposure.
Definition at line 1700 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.applyElectrostaticBrighterFatterCorrection | ( | self, | |
| ccdExposure, | |||
| flat, | |||
| dark, | |||
| electroBfDistortionMatrix, | |||
| brighterFatterApplyGain, | |||
| bfGains ) |
Apply an electrostatic brighter fatter correction to the image
using the method defined in Astier et al. 2023.
Note that this correction requires that the image is in units
electrons.
Parameters
----------
ccdExposure : `lsst.afw.image.Exposure`
Exposure to process.
flat : `lsst.afw.image.Exposure`
Flat exposure the same size as ``exp``.
dark : `lsst.afw.image.Exposure`, optional
Dark exposure the same size as ``exp``.
electroBfDistortionMatrix : `lsst.ip.isr.ElectrostaticBrighterFatter`
The brighter-fatter kernel.
brighterFatterApplyGain : `bool`
Apply the gain to convert the image to electrons?
bfGains : `dict`
The gains to use if brighterFatterApplyGain = True.
Yields
------
exp : `lsst.afw.image.Exposure`
The flat and dark corrected exposure.
Definition at line 1542 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.applyFluxConservingBrighterFatterCorrection | ( | self, | |
| ccdExposure, | |||
| flat, | |||
| dark, | |||
| bfKernel, | |||
| brighterFatterApplyGain, | |||
| bfGains ) |
Apply a brighter fatter correction to the image using the
method defined in Coulton et al. 2019 with flux-conserving
corrections.
Note that this correction requires that the image is in units
electrons.
Parameters
----------
ccdExposure : `lsst.afw.image.Exposure`
Exposure to process.
flat : `lsst.afw.image.Exposure`
Flat exposure the same size as ``exp``.
dark : `lsst.afw.image.Exposure`, optional
Dark exposure the same size as ``exp``.
bfKernel : `lsst.ip.isr.BrighterFatterKernel`
The brighter-fatter kernel.
brighterFatterApplyGain : `bool`
Apply the gain to convert the image to electrons?
bfGains : `dict`
The gains to use if brighterFatterApplyGain = True.
Yields
------
exp : `lsst.afw.image.Exposure`
The flat and dark corrected exposure.
Definition at line 1613 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.checkAllBadAmps | ( | self, | |
| badAmpDict, | |||
| detector ) |
Check if all amps are marked as bad.
Parameters
----------
badAmpDict : `str`[`bool`]
Dictionary of amplifiers, keyed by name, value is True if
amplifier is fully masked.
detector : `lsst.afw.cameraGeom.Detector`
Detector object.
Raises
------
UnprocessableDataError if all amps are bad and doCheckUnprocessableData
configuration is True.
Definition at line 880 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.checkAmpNoise | ( | self, | |
| badAmpDict, | |||
| exposure, | |||
| ptc ) |
Check if amplifier noise levels are above threshold.
Any amplifier that is above the noise level will be masked as BAD
and added to the badAmpDict.
Parameters
----------
badAmpDict : `str` [`bool`]
Dictionary of amplifiers, keyed by name, value is True if
amplifier is fully masked.
exposure : `lsst.afw.image.Exposure`
Input exposure to be masked (untrimmed).
ptc : `lsst.ip.isr.PhotonTransferCurveDataset`
PTC dataset with gains/read noises.
Returns
-------
badAmpDict : `str`[`bool`]
Dictionary of amplifiers, keyed by name.
Definition at line 964 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.checkAmpOverscanLevel | ( | self, | |
| badAmpDict, | |||
| exposure, | |||
| ptc ) |
Check if the amplifier overscan levels have changed.
Any amplifier that has an overscan median level that has changed
significantly will be masked as BAD and added to toe badAmpDict.
Parameters
----------
badAmpDict : `str` [`bool`]
Dictionary of amplifiers, keyed by name, value is True if
amplifier is fully masked.
exposure : `lsst.afw.image.Exposure`
Input exposure to be masked (untrimmed).
ptc : `lsst.ip.isr.PhotonTransferCurveDataset`
PTC dataset with gains/read noises.
Returns
-------
badAmpDict : `str`[`bool`]
Dictionary of amplifiers, keyed by name.
Definition at line 905 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.checkBssVoltage | ( | self, | |
| exposure ) |
Check the back-side bias voltage to see if the detector is on.
Parameters
----------
exposure : `lsst.afw.image.ExposureF`
Input exposure.
Raises
------
`UnprocessableDataError` if voltage is off.
Definition at line 1959 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.compareUnits | ( | self, | |
| calibMetadata, | |||
| calibName ) |
Compare units from calibration to ISR units.
This compares calibration units (adu or electron) to whether
doApplyGain is set.
Parameters
----------
calibMetadata : `lsst.daf.base.PropertyList`
Calibration metadata from header.
calibName : `str`
Calibration name for log message.
Definition at line 1848 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.convertIntToFloat | ( | self, | |
| exposure ) |
Convert exposure image from uint16 to float.
If the exposure does not need to be converted, the input is
immediately returned. For exposures that are converted to use
floating point pixels, the variance is set to unity and the
mask to zero.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
The raw exposure to be converted.
Returns
-------
newexposure : `lsst.afw.image.Exposure`
The input ``exposure``, converted to floating point pixels.
Raises
------
RuntimeError
Raised if the exposure type cannot be converted to float.
Definition at line 1879 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.darkCorrection | ( | self, | |
| exposure, | |||
| darkExposure, | |||
| invert = False ) |
Apply dark correction in place.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure to process.
darkExposure : `lsst.afw.image.Exposure`
Dark exposure of the same size as ``exposure``.
invert : `Bool`, optional
If True, re-add the dark to an already corrected image.
Raises
------
RuntimeError
Raised if either ``exposure`` or ``darkExposure`` do not
have their dark time defined.
See Also
--------
lsst.ip.isr.isrFunctions.darkCorrection
Definition at line 1781 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.diffNonLinearCorrection | ( | self, | |
| ccdExposure, | |||
| dnlLUT, | |||
| ** | kwargs ) |
Definition at line 810 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.ditherCounts | ( | self, | |
| exposure, | |||
| detectorConfig, | |||
| fallbackSeed = 12345 ) |
Dither the counts in the exposure.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
The raw exposure to be dithered.
detectorConfig : `lsst.ip.isr.OverscanDetectorConfig`
Configuration for overscan/etc for this detector.
fallbackSeed : `int`, optional
Random seed to fall back to if exposure.getInfo().getId() is
not set.
Definition at line 1916 of file isrTaskLSST.py.
|
static |
Extract common calibration metadata values that will be written to
output header.
Parameters
----------
calib : `lsst.afw.image.Exposure` or `lsst.ip.isr.IsrCalib`
Calibration to pull date information from.
Returns
-------
dateString : `str`
Calibration creation date string to add to header.
Definition at line 1824 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.flatContext | ( | self, | |
| exp, | |||
| flat, | |||
| dark = None ) |
Context manager that applies and removes flats and darks,
if the task is configured to apply them.
Parameters
----------
exp : `lsst.afw.image.Exposure`
Exposure to process.
flat : `lsst.afw.image.Exposure`
Flat exposure the same size as ``exp``.
dark : `lsst.afw.image.Exposure`, optional
Dark exposure the same size as ``exp``.
Yields
------
exp : `lsst.afw.image.Exposure`
The flat and dark corrected exposure.
Definition at line 1494 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.getBrighterFatterKernel | ( | self, | |
| detector, | |||
| bfKernel ) |
Definition at line 1524 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.makeBinnedImages | ( | self, | |
| exposure ) |
Make visualizeVisit style binned exposures.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure to bin.
Returns
-------
bin1 : `lsst.afw.image.Exposure`
Binned exposure using binFactor1.
bin2 : `lsst.afw.image.Exposure`
Binned exposure using binFactor2.
Definition at line 2000 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.maskDefects | ( | self, | |
| exposure, | |||
| defectBaseList ) |
Mask defects using mask plane "BAD", in place.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure to process.
defectBaseList : defect-type
List of defects to mask. Can be of type `lsst.ip.isr.Defects`
or `list` of `lsst.afw.image.DefectBase`.
Definition at line 1373 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.maskEdges | ( | self, | |
| exposure, | |||
| numEdgePixels = 0, | |||
| maskPlane = "SUSPECT", | |||
| level = 'DETECTOR' ) |
Mask edge pixels with applicable mask plane.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure to process.
numEdgePixels : `int`, optional
Number of edge pixels to mask.
maskPlane : `str`, optional
Mask plane name to use.
level : `str`, optional
Level at which to mask edges.
Definition at line 1406 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.maskFullAmplifiers | ( | self, | |
| ccdExposure, | |||
| detector, | |||
| defects, | |||
| gains = None ) |
Check for fully masked bad amplifiers and mask them.
This includes defects which cover full amplifiers, as well
as amplifiers with nan gain values which should be used
if self.config.doApplyGains=True.
Full defect masking happens later to allow for defects which
cross amplifier boundaries.
Parameters
----------
ccdExposure : `lsst.afw.image.Exposure`
Input exposure to be masked.
detector : `lsst.afw.cameraGeom.Detector`
Detector object.
defects : `lsst.ip.isr.Defects`
List of defects. Used to determine if an entire
amplifier is bad.
gains : `dict` [`str`, `float`], optional
Dictionary of gains to check if
self.config.doApplyGains=True.
Returns
-------
badAmpDict : `str`[`bool`]
Dictionary of amplifiers, keyed by name, value is True if
amplifier is fully masked.
Definition at line 815 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.maskITLSatEdgesAndColumns | ( | self, | |
| exposure, | |||
| badAmpDict ) |
Definition at line 1112 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.maskNan | ( | self, | |
| exposure ) |
Mask NaNs using mask plane "UNMASKEDNAN", in place.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure to process.
Notes
-----
We mask over all non-finite values (NaN, inf), including those
that are masked with other bits (because those may or may not be
interpolated over later, and we want to remove all NaN/infs).
Despite this behaviour, the "UNMASKEDNAN" mask plane is used to
preserve the historical name.
Definition at line 1440 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.maskNegativeVariance | ( | self, | |
| exposure ) |
Identify and mask pixels with negative variance values.
Parameters
----------
exposure : `lsst.afw.image.Exposure`
Exposure to process.
See Also
--------
lsst.ip.isr.isrFunctions.updateVariance
Definition at line 1304 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.maskSaturatedPixels | ( | self, | |
| badAmpDict, | |||
| ccdExposure, | |||
| detector, | |||
| detectorConfig, | |||
| ptc = None ) |
Mask SATURATED and SUSPECT pixels and check if any amplifiers
are fully masked.
Parameters
----------
badAmpDict : `str` [`bool`]
Dictionary of amplifiers, keyed by name, value is True if
amplifier is fully masked.
ccdExposure : `lsst.afw.image.Exposure`
Input exposure to be masked.
detector : `lsst.afw.cameraGeom.Detector`
Detector object.
defects : `lsst.ip.isr.Defects`
List of defects. Used to determine if an entire
amplifier is bad.
detectorConfig : `lsst.ip.isr.OverscanDetectorConfig`
Per-amplifier configurations.
ptc : `lsst.ip.isr.PhotonTransferCurveDataset`, optional
PTC dataset (used if configured to use PTCTURNOFF).
Returns
-------
badAmpDict : `str`[`bool`]
Dictionary of amplifiers, keyed by name.
Definition at line 1018 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.overscanCorrection | ( | self, | |
| mode, | |||
| detectorConfig, | |||
| detector, | |||
| badAmpDict, | |||
| ccdExposure ) |
Apply serial overscan correction in place to all amps.
The actual overscan subtraction is performed by the
`lsst.ip.isr.overscan.OverscanTask`, which is called here.
Parameters
----------
mode : `str`
Must be `SERIAL` or `PARALLEL`.
detectorConfig : `lsst.ip.isr.OverscanDetectorConfig`
Per-amplifier configurations.
detector : `lsst.afw.cameraGeom.Detector`
Detector object.
badAmpDict : `dict`
Dictionary of amp name to whether it is a bad amp.
ccdExposure : `lsst.afw.image.Exposure`
Exposure to have overscan correction performed.
Returns
-------
overscans : `list` [`lsst.pipe.base.Struct` or None]
Overscan measurements (always in adu).
Each result struct has components:
``imageFit``
Value or fit subtracted from the amplifier image data.
(scalar or `lsst.afw.image.Image`)
``overscanFit``
Value or fit subtracted from the overscan image data.
(scalar or `lsst.afw.image.Image`)
``overscanImage``
Image of the overscan region with the overscan
correction applied. This quantity is used to estimate
the amplifier read noise empirically.
(`lsst.afw.image.Image`)
``overscanMean``
Mean overscan fit value. (`float`)
``overscanMedian``
Median overscan fit value. (`float`)
``overscanSigma``
Clipped standard deviation of the overscan fit. (`float`)
``residualMean``
Mean of the overscan after fit subtraction. (`float`)
``residualMedian``
Median of the overscan after fit subtraction. (`float`)
``residualSigma``
Clipped standard deviation of the overscan after fit
subtraction. (`float`)
See Also
--------
lsst.ip.isr.overscan.OverscanTask
Definition at line 1145 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.run | ( | self, | |
| ccdExposure, | |||
| * | , | ||
| dnlLUT = None, | |||
| bias = None, | |||
| deferredChargeCalib = None, | |||
| linearizer = None, | |||
| ptc = None, | |||
| gainCorrection = None, | |||
| crosstalk = None, | |||
| defects = None, | |||
| bfKernel = None, | |||
| electroBfDistortionMatrix = None, | |||
| dark = None, | |||
| flat = None, | |||
| camera = None ) |
Run the IsrTaskLSST task.
Parameters
----------
ccdExposure : `lsst.afw.image.Exposure`
Exposure to run ISR.
dnlLUT : `None`, optional
DNL lookup table; placeholder, unused.
bias : `lsst.afw.image.Exposure`, optional
Bias frame.
deferredChargeCalib : `lsst.ip.isr.DeferredChargeCalib`, optional
Deferred charge calibration.
linearizer : `lsst.ip.isr.Linearizer`, optional
Linearizer calibration.
ptc : `lsst.ip.isr.PhotonTransferCurveDataset`, optional
PTC dataset.
gainCorrection : `lsst.ip.isr.GainCorrection`, optional
Gain correction dataset.
crosstalk : `lsst.ip.isr.CrosstalkCalib`, optional
Crosstalk calibration dataset.
defects : `lsst.ip.isr.Defects`, optional
Defects dataset.
bfKernel : `lsst.ip.isr.BrighterFatterKernel`, optional
Brighter-fatter kernel dataset.
dark : `lsst.afw.image.Exposure`, optional
Dark frame.
flat : `lsst.afw.image.Exposure`, optional
Flat-field frame.
camera : `lsst.afw.cameraGeom.Camera`, optional
Camera object.
Returns
-------
result : `lsst.pipe.base.Struct`
Struct with fields:
``exposure``: `lsst.afw.image.Exposure`
Calibrated exposure.
``outputBin1Exposure``: `lsst.afw.image.Exposure`
Binned exposure (bin1 config).
``outputBin2Exposure``: `lsst.afw.image.Exposure`
Binned exposure (bin2 config).
``outputExposure``: `lsst.afw.image.Exposure`
Calibrated exposure (same as ``exposure``).
``outputStatistics``: `lsst.ip.isr.isrStatistics`
Calibrated exposure statistics.
Definition at line 2028 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.runQuantum | ( | self, | |
| butlerQC, | |||
| inputRefs, | |||
| outputRefs ) |
Definition at line 749 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.setBadRegions | ( | self, | |
| exposure ) |
Set bad regions from large contiguous regions.
Parameters
----------
exposure : `lsst.afw.Exposure`
Exposure to set bad regions.
Notes
-----
Reset and interpolate bad pixels.
Large contiguous bad regions (which should have the BAD mask
bit set) should have their values set to the image median.
This group should include defects and bad amplifiers. As the
area covered by these defects are large, there's little
reason to expect that interpolation would provide a more
useful value.
Smaller defects can be safely interpolated after the larger
regions have had their pixel values reset. This ensures
that the remaining defects adjacent to bad amplifiers (as an
example) do not attempt to interpolate extreme values.
Definition at line 1465 of file isrTaskLSST.py.
| lsst.ip.isr.isrTaskLSST.IsrTaskLSST.validateInput | ( | self, | |
| inputs ) |
This is a check that all the inputs required by the config are available.
Definition at line 776 of file isrTaskLSST.py.
|
staticprotected |
Definition at line 737 of file isrTaskLSST.py.
|
static |
Definition at line 736 of file isrTaskLSST.py.