diff --git a/python/lsst/pipe/tasks/selectImages.py b/python/lsst/pipe/tasks/selectImages.py index e125f114c..3b9fb246d 100644 --- a/python/lsst/pipe/tasks/selectImages.py +++ b/python/lsst/pipe/tasks/selectImages.py @@ -407,9 +407,9 @@ class BestSeeingSelectVisitsConfig(pipeBase.PipelineTaskConfig, pipelineConnections=BestSeeingSelectVisitsConnections): nVisitsMax = pexConfig.RangeField( dtype=int, - doc="Maximum number of visits to select", + doc="Maximum number of visits to select; use -1 to select all.", default=12, - min=0 + min=-1, ) maxPsfFwhm = pexConfig.Field( dtype=float, @@ -520,8 +520,11 @@ def run(self, visitSummaries, skyMap, dataId): visits.append(visit) sortedVisits = [ind for (_, ind) in sorted(zip(fwhmSizes, visits))] - output = sortedVisits[:self.config.nVisitsMax] - self.log.info("%d images selected with FWHM range of %d--%d arcseconds", + if self.config.nVisitsMax < 0: + 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])]) # In order to store as a StructuredDataDict, convert list to dict