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-26418: Fix logic when cleaning up the fake cat. #406
Conversation
@@ -649,7 +648,7 @@ def mkFakeStars(self, fakeCat, band, photoCalib, psf, image): | |||
starIm *= flux | |||
yield ((starIm.convertF(), xy)) | |||
|
|||
def cleanCat(self, fakeCat): | |||
def cleanCat(self, fakeCat, starCheckVal): | |||
"""Remove rows from the fakes catalog which have HLR = 0 for either the buldge or disk component, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc string should probably be updated to reflect the new functionality being added.
& (fakeCat[self.config.nDisk] >= minN) & (fakeCat[self.config.nDisk] <= maxN)) | ||
numRowsNotUsed = len(fakeCat) - len(rowsToKeep) | ||
| (fakeCat[self.config.sourceType] == starCheckVal)) | ||
numRowsNotUsed = len(fakeCat) - len(np.where(rowsToKeep)[0]) | ||
self.log.info("Removing %d rows with nBulge or nDisk outside of %0.2f <= n <= %0.2f" % |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, it would be helpful for this logger text to also be updated to reflect the new functionality being added.
self.log.info("Removing %d rows with nBulge or nDisk outside of %0.2f <= n <= %0.2f" % | ||
(numRowsNotUsed, minN, maxN)) | ||
fakeCat = fakeCat[rowsToKeep] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check I understand this correctly - on this line you're first trimming fakeCat
of bad Sersic sources unless they're stars, and then in the if
block below, you're further trimming it to the sourceSelectionColName
sources if doSubSelectSources=True
? I was thrown at first because the rowsToKeep
variable was reassigned, and I didn't catch that above! Maybe change this second variable name to selectedSources
, or similar, to avoid confusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the names, yes there is three steps of cleaning.
a7b80fa
to
d0b37b6
Compare
d0b37b6
to
6eb1b09
Compare
No description provided.