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-26418: Fix logic when cleaning up the fake cat. #406

Merged
merged 1 commit into from Aug 22, 2020
Merged

Conversation

sr525
Copy link
Contributor

@sr525 sr525 commented Aug 21, 2020

No description provided.

@sr525 sr525 changed the title Fix logic when cleaning up the fake cat. DM-26418: Fix logic when cleaning up the fake cat. Aug 21, 2020
@@ -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,
Copy link
Contributor

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" %
Copy link
Contributor

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]
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@sr525 sr525 merged commit 3be7e53 into master Aug 22, 2020
@timj timj deleted the tickets/DM-26418 branch February 18, 2021 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants