Skip to content

Commit

Permalink
Add doRequirePrimary to default source selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed May 25, 2023
1 parent 7457645 commit 3cc2d46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/lsst/drp/tasks/gbdesAstrometricFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ def setDefaults(self):
]
self.sourceSelector['science'].flags.bad = badFlags

# Use only primary sources.
self.sourceSelector['science'].doRequirePrimary = True

def validate(self):
super().validate()

Expand Down Expand Up @@ -871,6 +874,8 @@ class `wcsfit.FoFClass`, associating them into matches as you go.
if self.sourceSelector.config.doIsolated:
columns.append(self.sourceSelector.config.isolated.parentName)
columns.append(self.sourceSelector.config.isolated.nChildName)
if self.sourceSelector.config.doRequirePrimary:
columns.append(self.sourceSelector.config.requirePrimary.primaryColName)

sourceIndices = [None] * len(extensionInfo.visit)
for inputCatalogRef in inputCatalogRefs:
Expand Down
1 change: 1 addition & 0 deletions tests/test_gbdesAstrometricFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def _make_sourceCat(cls, starIds, starRas, starDecs, trueWCSs, inScienceFraction
'deblend_nChild', 'ixy']:
sourceDict[key] = zeros_like
sourceDict['apFlux_12_0_instFluxErr'] = 1e-3 * ones_like
sourceDict['detect_isPrimary'] = ones_like.astype(bool)

sourceCat = pd.DataFrame(sourceDict)
sourceCats.append(sourceCat)
Expand Down

0 comments on commit 3cc2d46

Please sign in to comment.