22__all__ = [
"StrayLightConfig",
"StrayLightTask",
"StrayLightData"]
24from abc
import abstractmethod
25from typing
import Optional
28from lsst.pipe.base
import Task
30from .isrFunctions
import checkFilter
31from .calibType
import IsrCalib
35 doRotatorAngleCorrection = Field(
37 doc=
"Rotator angle correction configuration.",
43 doc=
"Filters that need straylight correction.",
49 """Remove stray light from instruments.
51 This is a dummy task to be retargeted
with an camera-specific version.
53 ConfigClass = StrayLightConfig
54 _DefaultName = "isrStrayLight"
57 """Check if stray light correction should be run.
66 def run(self, exposure, strayLightData):
67 """Correct stray light.
73 strayLightData : `object`, optional
74 An opaque object that contains any calibration data used to
75 correct for stray light.
77 raise NotImplementedError(
"Must be implemented by subclasses.")
79 def checkFilter(self, exposure):
80 """Check whether we should fringe-subtract the science exposure.
85 Exposure to check the filter of.
90 If True, then the exposure has a filter listed
in the
91 configuration,
and should have the fringe applied.
93 return checkFilter(exposure, self.config.filters, log=self.log)
97 """An abstract base class for rotator-dependent stray light information.
101 def evaluate(self, angle_start: Angle, angle_end: Optional[Angle] =
None):
102 """Get a stray light array for a range of rotator angles.
106 angle_begin : `float`
107 Instrument rotation angle at the start of the exposure.
108 angle_end : `float`, optional
109 Instrument rotation angle at the end of the exposure.
110 If not provided, the returned array will reflect a snapshot at
115 array : `numpy.ndarray`
116 A stray-light background image
for this exposure.
118 raise NotImplementedError(
"Must be implemented by subclasses.")
evaluate(self, Angle angle_start, Optional[Angle] angle_end=None)
run(self, exposure, strayLightData)