From fdeb0c602e1ea16c6ab38c0e881b579b1c2f7429 Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Wed, 1 Nov 2023 11:50:33 -0700 Subject: [PATCH 1/3] Allow BestSeeingSelectVisits to use all input visits. --- python/lsst/pipe/tasks/selectImages.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/lsst/pipe/tasks/selectImages.py b/python/lsst/pipe/tasks/selectImages.py index e125f114c..d9f83924e 100644 --- a/python/lsst/pipe/tasks/selectImages.py +++ b/python/lsst/pipe/tasks/selectImages.py @@ -409,7 +409,7 @@ class BestSeeingSelectVisitsConfig(pipeBase.PipelineTaskConfig, dtype=int, doc="Maximum number of visits to select", default=12, - min=0 + min=-1, ) maxPsfFwhm = pexConfig.Field( dtype=float, @@ -520,7 +520,10 @@ def run(self, visitSummaries, skyMap, dataId): visits.append(visit) sortedVisits = [ind for (_, ind) in sorted(zip(fwhmSizes, visits))] - output = sortedVisits[:self.config.nVisitsMax] + if self.config.nVisitsMax < 0: + output = sortedVisits + else: + output = sortedVisits[:self.config.nVisitsMax] self.log.info("%d images selected with FWHM range of %d--%d arcseconds", len(output), fwhmSizes[visits.index(output[0])], fwhmSizes[visits.index(output[-1])]) From a3c946ea7d804382ddcbd1116b6529f4a6438ff8 Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Wed, 1 Nov 2023 11:51:45 -0700 Subject: [PATCH 2/3] Improve docstring for nVisitsMax. --- python/lsst/pipe/tasks/selectImages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/pipe/tasks/selectImages.py b/python/lsst/pipe/tasks/selectImages.py index d9f83924e..578b27725 100644 --- a/python/lsst/pipe/tasks/selectImages.py +++ b/python/lsst/pipe/tasks/selectImages.py @@ -407,7 +407,7 @@ 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=-1, ) From 19708fbed6442b061a4a32c67c764440c1cb9802 Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Wed, 1 Nov 2023 13:04:18 -0700 Subject: [PATCH 3/3] Fix logging to of seeing to use floats instead of truncated integers. --- python/lsst/pipe/tasks/selectImages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/pipe/tasks/selectImages.py b/python/lsst/pipe/tasks/selectImages.py index 578b27725..3b9fb246d 100644 --- a/python/lsst/pipe/tasks/selectImages.py +++ b/python/lsst/pipe/tasks/selectImages.py @@ -524,7 +524,7 @@ def run(self, visitSummaries, skyMap, dataId): output = sortedVisits else: output = sortedVisits[:self.config.nVisitsMax] - self.log.info("%d images selected with FWHM range of %d--%d arcseconds", + 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