Skip to content

Commit

Permalink
Add requireFiniteRaDec clause to source selector
Browse files Browse the repository at this point in the history
We are now persisting source catalogs even in light of an astrometric
failure in single frame processing.  Such catalogs will have their sky
coordinate column (typically "coord_ra" and "coord_dec") values set to
NaN.  They are thus not suitable for inclusion in the jointcal
calibration, so this config default ensures they are omited from the
selection of "good" sources.
  • Loading branch information
laurenam committed Sep 1, 2022
1 parent ba36e88 commit cb51f12
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/lsst/jointcal/jointcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ def setDefaults(self):
f"{self.sourceFluxType}_flag",
]
self.sourceSelector["science"].flags.bad = badFlags
self.sourceSelector["science"].doRequireFiniteRaDec = True
self.sourceSelector["science"].requireFiniteRaDec.raColName = "ra"
self.sourceSelector["science"].requireFiniteRaDec.decColName = "decl"

# Use Gaia-DR2 with proper motions for astrometry; phot_g_mean is the
# primary Gaia band, but is not like any normal photometric band.
Expand Down Expand Up @@ -799,6 +802,8 @@ def _load_data(self, inputSourceTableVisit, inputVisitSummary, associations,
visitCatalog = dataRef.get(parameters={'columns': columns})

selected = self.sourceSelector.run(visitCatalog)
if len(selected) == 0:
raise RuntimeError("No data to process: the source selector removed all sources")

# Build a CcdImage for each detector in this visit.
detectors = {id: index for index, id in enumerate(visitSummary['id'])}
Expand Down Expand Up @@ -1604,6 +1609,9 @@ def get_sourceTable_visit_columns(inColumns, config, sourceSelector):
if sourceSelector.config.doIsolated:
columns.append(sourceSelector.config.isolated.parentName)
columns.append(sourceSelector.config.isolated.nChildName)
if sourceSelector.config.doRequireFiniteRaDec:
columns.append(sourceSelector.config.requireFiniteRaDec.raColName)
columns.append(sourceSelector.config.requireFiniteRaDec.decColName)

return columns, detectorColumn, ixxColumns

Expand Down

0 comments on commit cb51f12

Please sign in to comment.