21 from abc
import ABC, abstractmethod
22 from typing
import Optional
30 doRotatorAngleCorrection = Field(
38 doc=
"Filters that need straylight correction.",
44 """Remove stray light from instruments.
46 This is a dummy task to be retargeted with an camera-specific version.
48 ConfigClass = StrayLightConfig
49 _DefaultName =
"isrStrayLight"
52 """Read and return calibration products relevant for correcting
53 stray light in the given exposure.
57 dataRef : `daf.persistence.butlerSubset.ButlerDataRef`
58 Butler reference of the detector data to be processed
59 rawExposure : `afw.image.Exposure`
60 The raw exposure that will later be corrected with the
61 retrieved calibration data; should not be modified in this
66 straylightData : `object`, optional
67 An opaque object that should be passed as the second argument to
68 the `run` method. If `None`, no stray light correction will be
69 performed for the given image. Any other object (e.g. `True`)
70 may be used to signal that stray light correction should be
71 performed even if there is nothing to read.
75 This method will be called only when `IsrTask` is run by the Gen2
76 Middleware (i.e. CmdLineTask).
81 """Check if stray light correction should be run.
85 exposure : `lsst.afw.image.Exposure`
90 def run(self, exposure, strayLightData):
91 """Correct stray light.
95 exposure : `lsst.afw.image.Exposure`
97 strayLightData : `object`, optional
98 An opaque object that contains any calibration data used to
99 correct for stray light.
101 raise NotImplementedError(
"Must be implemented by subclasses.")
104 """Check whether we should fringe-subtract the science exposure.
108 exposure : `lsst.afw.image.Exposure`
109 Exposure to check the filter of.
114 If True, then the exposure has a filter listed in the
115 configuration, and should have the fringe applied.
117 return exposure.getFilter().getName()
in self.config.filters
121 """An abstract base class for rotator-dependent stray light information.
125 def evaluate(self, angle_start: Angle, angle_end: Optional[Angle] =
None):
126 """Get a stray light array for a range of rotator angles.
130 angle_begin : `float`
131 Instrument rotation angle at the start of the exposure.
132 angle_end : `float`, optional
133 Instrument rotation angle at the end of the exposure.
134 If not provided, the returned array will reflect a snapshot at
139 array : `numpy.ndarray`
140 A stray-light background image for this exposure.
142 raise NotImplementedError(
"Must be implemented by subclasses.")
def evaluate(self, Angle angle_start, Optional[Angle] angle_end=None)
def check(self, exposure)
def checkFilter(self, exposure)
def run(self, exposure, strayLightData)
def readIsrData(self, dataRef, rawExposure)