Skip to content

Commit

Permalink
Add validation for centroiding tasks on task init
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Aug 16, 2024
1 parent c4d71a3 commit fe300d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/lsst/atmospec/centroiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ def setDefaults(self):
self.astrometry.sourceSelector["science"].doRequirePrimary = False
self.astrometry.sourceSelector["science"].doIsolated = False

def validate(self):
super().validate()
task = self.centroidingFallbackTask
# note these aren't instantiated yet, so we can't check the type
# of the instance, just the target. _DefaultName is a class attribute
# that definitely exists, but has a lower case first letter.
if task.target._DefaultName not in ('quickFrameMeasurementTask', 'peekExposureTask'):
raise ValueError(f"centroidingFallbackTask is of unknown type {task.target}")


class SingleStarCentroidTask(pipeBase.PipelineTask):
"""XXX Docs here
Expand Down

0 comments on commit fe300d4

Please sign in to comment.