29 __all__ = [
"CpFringeTask",
"CpFringeTaskConfig"]
33 dimensions=(
"instrument",
"exposure",
"detector")):
36 doc=
"Input pre-processed exposures to combine.",
37 storageClass=
"Exposure",
38 dimensions=(
"instrument",
"exposure",
"detector"),
41 outputExp = cT.Output(
43 doc=
"Output combined proposed calibration.",
44 storageClass=
"Exposure",
45 dimensions=(
"instrument",
"exposure",
"detector"),
50 pipelineConnections=CpFringeConnections):
51 stats = pexConfig.ConfigurableField(
53 doc=
"Statistics task to use.",
55 subtractBackground = pexConfig.ConfigurableField(
56 target=measAlg.SubtractBackgroundTask,
57 doc=
"Background configuration",
59 detection = pexConfig.ConfigurableField(
60 target=measAlg.SourceDetectionTask,
61 doc=
"Detection configuration",
63 detectSigma = pexConfig.Field(
66 doc=
"Detection psf gaussian sigma.",
70 self.
detectiondetection.reEstimateBackground =
False
74 pipeBase.CmdLineTask):
75 """Combine pre-processed fringe frames into a proposed master calibration.
77 ConfigClass = CpFringeTaskConfig
78 _DefaultName =
"cpFringe"
82 self.makeSubtask(
"stats")
83 self.makeSubtask(
"subtractBackground")
84 self.makeSubtask(
"detection")
86 def run(self, inputExp):
87 """Preprocess input exposures prior to FRINGE combination.
89 This task scales and renormalizes the input frame based on the
90 image background, and then masks all pixels above the
95 inputExp : `lsst.afw.image.Exposure`
96 Pre-processed fringe frame data to combine.
100 outputExp : `lsst.afw.image.Exposure`
101 Fringe pre-processed frame.
104 bg = self.stats.
run(inputExp)
105 self.subtractBackground.
run(inputExp)
106 mi = inputExp.getMaskedImage()
109 fpSets = self.detection.detectFootprints(inputExp, sigma=self.config.detectSigma)
111 detected = 1 << mask.addMaskPlane(
"DETECTED")
112 for fpSet
in (fpSets.positive, fpSets.negative):
113 if fpSet
is not None:
114 afwDet.setMaskFromFootprintList(mask, fpSet.getFootprints(), detected)
116 return pipeBase.Struct(
def __init__(self, **kwargs)