Skip to content
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
19 changes: 19 additions & 0 deletions python/lsst/drp/tasks/gbdesAstrometricFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,14 @@ class GbdesAstrometricFitConfig(
optional=True,
default=None,
)
minDetectorFraction = pexConfig.Field(
dtype=float,
doc=(
"Minimum fraction of detectors with valid WCSs per visit required to include the visit in the "
"fit."
),
default=0.25,
)

def setDefaults(self):
# Use only stars because aperture fluxes of galaxies are biased and
Expand Down Expand Up @@ -1138,6 +1146,17 @@ def _get_exposure_info(
# We want the position in AU in Cartesian coordinates
observatories.append(observatory_icrs.cartesian.xyz.to(u.AU).value)

validDetectors = [row for row in visitSummary if row.wcs is not None]
nDetectorFraction = len(validDetectors) / len(visitSummary)
if nDetectorFraction < self.config.minDetectorFraction:
self.log.warning(
"Visit %d has only %d detectors with valid WCSs (%s of total) and will be dropped.",
visit,
len(validDetectors),
nDetectorFraction,
)
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be an INFO or WARN level log message when skipping a visit?


for row in visitSummary:
detector = row["id"]

Expand Down