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-42126: Remove ignored detectors exposures from being processed in SubtractBrightStarsTask #869

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

bazkiaei
Copy link
Contributor

@bazkiaei bazkiaei commented Dec 12, 2023

No description provided.

@bazkiaei bazkiaei force-pushed the tickets/DM-42126 branch 2 times, most recently from 0c19e69 to cdf106d Compare December 14, 2023 22:57
@bazkiaei bazkiaei requested a review from leeskelvin December 15, 2023 04:44
Comment on lines 375 to 383
def detInRegions(self, inputs):
"""Determine whether the input exposure's detector is in the region(s)
where the extended PSF model(s) is(are) available.

Parameters
----------
inputs : `dict`
Dictionary containing the inputs to the task, including
`inputExposure` and `inputExtendedPsf`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than a single global inputs dict here, I think it would make more sense to split this into two required inputs: inputExposure and inputExtendedPsf. This will make it clear exactly what inputs from the input dict are required, what their purposes are, and prevent accidental usage of any other input.

@@ -364,6 +372,32 @@ def run(

return subtractorExp, invImages, badStamps

def detInRegions(self, inputs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intended to be used globally, outside this file? If not, we might consider renaming this to _detInRegions.

Comment on lines 391 to 396
availableDets = [
det
for detList in inputs["inputExtendedPsf"].detectors_focal_plane_regions.values()
for det in detList.detectors
]
if inputs["inputExposure"].detector.getId() in availableDets:
Copy link
Contributor

@leeskelvin leeskelvin Jan 4, 2024

Choose a reason for hiding this comment

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

I'm a fan of full words where possible. I think that helps readability in the future for other developers contributing to this package and maintaining it.

So here for example, availableDetectors for availableDets, detector for det and detectors for detList (or detectorList, if you want to avoid the subsequent detectors.detectors potential confusion). However, this is not a major comment, and I'll defer to you if you feel the way you have it now is more legible in general.

@bazkiaei bazkiaei merged commit 4412426 into main Jan 9, 2024
2 checks passed
@bazkiaei bazkiaei deleted the tickets/DM-42126 branch January 9, 2024 22:25
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.

2 participants