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-39141: Add doRequirePrimary to default source selector. #14

Merged
merged 1 commit into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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