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-32670: Running ISR and PTC task on BOT data on 189 CCDs fails at NCSA #113

Merged
merged 5 commits into from
Dec 4, 2021

Conversation

plazas
Copy link
Contributor

@plazas plazas commented Dec 1, 2021

No description provided.

Copy link
Collaborator

@mfisherlevine mfisherlevine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

@@ -240,7 +244,8 @@ def run(self, inputExp, inputDims):
"""
# inputExp.values() returns a view, which we turn into a list. We then
# access the first exposure-ID tuple to get the detector.
detector = list(inputExp.values())[0][0][0].getDetector()
# The first "get()" retrieves the exposure from the exposure reference.
detector = list(inputExp.values())[0][0][0].get().getDetector()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this results in getting the whole first exposure twice (once here, and once later when it's used) or if that's smart enough to just get the detector. I suspect it's not that smart though. But I also am not convinced it's worth the extra code complexity for special-casing the first exp, given the overhead, and how often this is called, so I guess leave as-is.

exp2, expId2 = exposures[1]
expRef1, expId1 = exposures[0]
expRef2, expId2 = exposures[1]
# use get() to obtain `lsst.afw.image.Exposure`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure comments for things that are so self-describing are worth it tbh, but up to you.

Comment on lines 646 to 647
(and their IDs) that have
the same exposure time (seconds).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put this line on the line above now it's short enough to be combined.

for exp, expId in zip(exposureList, exposureIdList):
expTime = exp.getInfo().getVisitInfo().getExposureTime()
for expRef, expId in zip(exposureList, exposureIdList):
expTime = expRef.get(component='visitInfo').exposureTime
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, given you can do this, now I do wonder if you can use the component='detector' for my first comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is much faster to get just the detector via the butler if you don't want the entire exposure read into memory.

Copy link
Contributor Author

@plazas plazas Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merlin: I woudl still need to get the exposure from the reference first, so it would not be much different to what's already above: detector=list(inputExp.values())[0][0][0].get().getDetector() vs list(inputExp.values())[0][0][0].get(component='detector') (if it works)
Tim: In this function in utils we don't need the detector. Are you referring to detector=list(inputExp.values())[0][0][0].get().getDetector() in the run method:

detector = list(inputExp.values())[0][0][0].get().getDetector()
? In that case, would I need to pass the butler to the run function as well from runQuantum? I wanted to just use the inputs to run: inputExp or inputDims

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was replying to Merlin's comment about component get vs Exposure get then getComponent -- of course if you need the Exposure then you should get the component from the exposure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the point being that you do need to get it, but at the moment you're getting the whole thing twice, and so changing the instance above (my first comment on the PR) would mean that the first time you don't also retrieve the image. Given there's a nice syntax for it, and it doesn't involve having to get the whole thing and then special case the first pass through this loop (which is what I was worrying about) it like is worth it after all, I'd imagine (though perhaps given caching, it really isn't goig to matter that much in practice).

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 see, thanks. I switched to using get(component='detector') above.

@plazas plazas force-pushed the tickets/DM-32670 branch 2 times, most recently from e680374 to f5935d8 Compare December 2, 2021 18:27
@plazas plazas merged commit 491245d into main Dec 4, 2021
@plazas plazas deleted the tickets/DM-32670 branch December 4, 2021 13:29
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

3 participants