Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41503: Allow BestSeeingSelectVisitsTask to select all visits below some fwhm cut #857

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions python/lsst/pipe/tasks/selectImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down