-
Notifications
You must be signed in to change notification settings - Fork 19
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-42776: Add star count number to the metadata of bright star stamp and extended PSF models #886
Conversation
… and extended PSF models
self.metadata["psfStarCount"] = 0 | ||
for brightStarStamps in bss_ref_list: | ||
stamps = brightStarStamps.get() | ||
self.metadata["psfStarCount"] += len(stamps) |
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 produces a change in behavior dependent upon whether the user has requested a region-based ePSF, or a per-detector/per-region based ePSF. That might cause confusion down the line when interpreting this metadata value, requiring an if/else
or a try/except
, or somehow parsing the detectors_focal_plane_regions
parameter further downstream.
My suggestion instead is to also construct a dict
here with a single entry. The key can be something simple like "full"
or "all"
(or something else you feel appropriate), and the value can be this summed number. Then, downstream, we can simply iterate over all psfStarCountDict.items()
or psfStarCountDict.values()
to get the metadata we need. Does that sound like a good idea here?
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.
Yes, I agree with you and it sounds like a good idea! I made modifications based on your comment.
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.
Great, thanks Amir, this looks great!
self.metadata["psfStarCount"][region_name] = 0 | ||
for brightStarStamps in ref_list: | ||
stamps = brightStarStamps.get() | ||
self.metadata["psfStarCount"][region_name] += len(stamps) |
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 you did for validStarCount
and allStarCount
, I'd suggest also adding a small in-line comment here to describe what this psfStarCount
code block is doing. (Both here, and replicated above for the non-regions approach).
562c02b
to
0fb7869
Compare
No description provided.