Skip to content

Commit

Permalink
Merge pull request #861 from lsst/tickets/DM-41646
Browse files Browse the repository at this point in the history
DM-41646: Fix logging when all visits rejected in BestSeeingSelectVisitsTask.
  • Loading branch information
erykoff authored Nov 9, 2023
2 parents 7e5a809 + 01f8263 commit a0be069
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions python/lsst/pipe/tasks/selectImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,17 @@ def run(self, visitSummaries, skyMap, dataId):
output = sortedVisits
else:
output = sortedVisits[:self.config.nVisitsMax]
self.log.info("%d images selected with FWHM range of %f--%f arcseconds",
len(output), fwhmSizes[visits.index(output[0])], fwhmSizes[visits.index(output[-1])])

if len(output) == 0:
self.log.info("All images rejected in BestSeeingSelectVisitsTask.")
raise pipeBase.NoWorkFound(f"No good images found for {dataId}")
else:
self.log.info(
"%d images selected with FWHM range of %f--%f arcseconds",
len(output),
fwhmSizes[visits.index(output[0])],
fwhmSizes[visits.index(output[-1])],
)

# In order to store as a StructuredDataDict, convert list to dict
goodVisits = {key: True for key in output}
Expand Down

0 comments on commit a0be069

Please sign in to comment.