Skip to content

Commit

Permalink
Add support for manual defects.
Browse files Browse the repository at this point in the history
  • Loading branch information
aferte committed Dec 11, 2024
1 parent 21778b9 commit 72f8570
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions pipelines/LSSTComCam/cpDefects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ tasks:
cpMergeDefects:
class: lsst.cp.pipe.MergeDefectsCombinedTask
config:
doManualDefects: True
edgesAsDefects: true
18 changes: 18 additions & 0 deletions python/lsst/cp/pipe/cpDefects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,13 @@ class MergeDefectsCombinedConnections(pipeBase.PipelineTaskConnections,
dimensions=("instrument", "detector", "physical_filter"),
multiple=True,
)
inputManualDefects = cT.Input(
name="cpManualDefects",
doc="Additional manual defects.",
storageClass="Defects",
dimensions=("instrument", "detector"),
multiple=True,
)
camera = cT.PrerequisiteInput(
name='camera',
doc="Camera associated with these defects.",
Expand All @@ -1149,11 +1156,22 @@ class MergeDefectsCombinedConnections(pipeBase.PipelineTaskConnections,
isCalibration=True,
)

def __init__(self, *, config=None):
super().__init__(config=config)

if config.doManualDefects is not True:
del self.inputManualDefects

class MergeDefectsCombinedTaskConfig(MergeDefectsTaskConfig,
pipelineConnections=MergeDefectsCombinedConnections):
"""Configuration for merging defects from combined exposure.
"""
doManualDefects = pexConfig.Field(
dtype=bool,
doc="Apply manual defects?",
default=False,
)

def validate(self):
super().validate()
if self.combinationMode != 'OR':
Expand Down

0 comments on commit 72f8570

Please sign in to comment.