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-31964: Fixup dimensions on ProcessCcdWithFakesTask/MatchFakesTask #611
Conversation
python/lsst/pipe/tasks/matchFakes.py
Outdated
for fakeCatRef in fakeCats: | ||
cat = fakeCatRef.get( | ||
datasetType=self.config.connections.fakeCats, | ||
immediate=True) |
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.
There is no immediate
keyword for get()
. Or maybe I'm misunderstanding. DeferredDatasetHandle.get()
doesn't take a datasetType parameter either.
python/lsst/pipe/tasks/matchFakes.py
Outdated
# Make sure all data is within the inner part of the tract. | ||
outputCat.append(cat[ | ||
skyMap.findTractIdArray(cat[self.config.raColName], | ||
cat[self.config.decColName], |
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.
@morriscb shouldn't these column names be self.config.ra_col
and self.config.dec_col
given that self.config.raColName
and self.config.decColName
are going to be deprecated?
fakeCats = cT.Input( | ||
doc="Set of catalogs of fake sources to draw inputs from. We will " | ||
"from one of these that fully contains our exposure or the is " | ||
"closest the visit boresight.", |
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.
@morriscb I guess the description here has a word missing between L68 and L69. L69 has the is
. I believe the description also does not reflect the fact that it gathers fake sources from other neighboring tracts as done in composeFakeCat
.
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, the doc string here doesn't read well - can you rephrase?
outputCat.append(cat[ | ||
skyMap.findTractIdArray(cat[self.config.insertFakes.raColName], | ||
cat[self.config.insertFakes.decColName], | ||
degrees=False) |
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.
@morriscb Same comment as above: self.config.insertfakes.raColName
and self.config.insertFakes.decColName
should be changed to self.config.ra_col
and self.config.dec_col
to remove deprecated column names.
if externalSkyWcsCatalogRef.dataId["tract"] == tractId: | ||
externalSkyWcsCatalog = externalSkyWcsCatalogRef.get( | ||
datasetType=self.config.connections.externalSkyWcsTractCatalog) | ||
break |
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.
@morriscb I have seen this return in some places with no externalSkyWcsCatalog
because the condition is never satisfied. You could let it use the last externalSkyWcsCatalog
with an else statement like:
else:
externalSkyWcsCatalog = externalSkyWcsCatalogRef.get(datasetType=self.config.connections.externalSkyWcsTractCatalog)
Similar problem for the photoCalib below in addition to a bug (see below L391).
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.
+1 for @surhudm's thinking above - it would be good for this large if/elif block to have a fall-back option in place.
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.
If the condition is never satisfied, that means there is no wcs or photocalib for that tract. I'm not sure what the safest fall back position. Likely people doing who have written the analysis code and use these calibs should decide.
for externalPhotoCalibCatalogRef in externalPhotoCalibCatalogList: | ||
if externalPhotoCalibCatalogRef.dataId["tract"] == tractId: | ||
externalPhotoCalibCatalog = externalPhotoCalibCatalogRef.get( | ||
datasetType=self.config.connections.externalSkyWcsTractCatalog) |
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.
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.
+1 again - seems like a copy/paste typo.
709c5a2
to
1e9f491
Compare
|
||
Returns | ||
------- | ||
fakeCat : `pandas.core.frame.DataFrame` | ||
fakeCats : `pandas.core.frame.DataFrame` |
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.
Please explain why this has been pluralized in the description for the parameter.
tests/test_matchFakes.py
Outdated
@@ -197,7 +124,8 @@ def testTrimCat(self): | |||
"""Test that the correct number of sources are in the ccd area. | |||
""" | |||
matchTask = MatchFakesTask() | |||
result = matchTask._trimFakeCat(self.fakeCat, self.exposure) | |||
result = matchTask._trimFakeCat( | |||
self.fakeCat, self.exposure) |
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 doesn't need to be on a new line.
Add code to concatenate fake catalogs. Fix linting. Add compose fakes to variablity code. Debug matchFakes. Add docs Simplify unittests. Remove unnessecary runQuantum test. Change coding dimensions. Fix linting. Output tract numbers. Fix linting. Access tractId Access tractId Fix ra/decColName usage. Remove immediate arg.
1e9f491
to
e1a9c35
Compare
Add code to concatenate fake catalogs.
Fix linting.
Add compose fakes to variablity code.
Debug matchFakes.
Add docs
Simplify unittests.
Remove unnessecary runQuantum test.
Change coding dimensions.
Fix linting.
Output tract numbers.
Fix linting.
Access tractId
Access tractId
Fix ra/decColName usage.