DM-50420: Inject variable sources into the template and science images#275
Merged
Conversation
64963f4 to
25f247c
Compare
25f247c to
c387c87
Compare
isullivan
approved these changes
Jun 5, 2026
isullivan
left a comment
Contributor
There was a problem hiding this comment.
Looks good! A few comments for readability, and potential bugs.
Comment on lines
+474
to
+475
| seed = int(str(visitId)+str(detId)) | ||
| rng = np.random.default_rng(seed) |
Contributor
There was a problem hiding this comment.
Suggested change
| seed = int(str(visitId)+str(detId)) | |
| rng = np.random.default_rng(seed) | |
| rng = np.random.default_rng([visitId, detId]) |
I am very wary of relying on string concatenation for creating the seed.
|
|
||
| def __init__(self, **kwargs): | ||
| super().__init__(**kwargs) | ||
| self.log = logging.getLogger(__name__) |
Contributor
There was a problem hiding this comment.
Not needed, this over-writes the inherited logger.
| catalog = vstack([catalog, variable_fakes]) | ||
|
|
||
| if len(catalog) > len(np.unique(catalog["injection_id"])): | ||
| self.log.warning("Duplicate injection IDs detected after catalog assembly; reassigning them.") |
Contributor
There was a problem hiding this comment.
This might be worth raising an error if there are duplicates, instead of warning and reassigning.
Member
Author
There was a problem hiding this comment.
I disagree, we are creating the injection ids here, so we just need to fix this. NO need to raise an error I think.
4efc359 to
3c640e3
Compare
3c640e3 to
1c0b4ee
Compare
1c0b4ee to
5f0e462
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create the fake injection pipeline tools for injection on template images.