-
Notifications
You must be signed in to change notification settings - Fork 15
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
RCAL-862 Refactor L3 Injection #132
RCAL-862 Refactor L3 Injection #132
Conversation
…to RCAL-862_RefactorL3Injection
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
==========================================
+ Coverage 89.73% 89.95% +0.22%
==========================================
Files 17 17
Lines 1743 1792 +49
==========================================
+ Hits 1564 1612 +48
- Misses 179 180 +1 ☔ View full report in Codecov by Sentry. |
method='phot', rng=rng) | ||
else: | ||
try: | ||
stamp = final.drawImage(center=image_pos, | ||
wcs=image.wcs.local(image_pos)) | ||
wcs=pwcs) |
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.
Probably around here need a:
if add_noise:
stamp.addNoise(galsim.PoissonNoise(rng))
to get around that issue we were discussing that noise is only added in photon-shooting / chromatic mode by default.
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.
I was saving that for RCAL-863.
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 looks good. I think the flux_to_counts_factor is missing the factor of abflux now, though; we should reflect a bit about units.
Since they're providing a source_cat the input units are ~required to be in maggies. The ultimate flux_to_counts_factor needs to then be abflux * exptime. Then there's the denominator, now convtimes, that needs to be counts / (target units), so 1 / exptime / (MJy / sr / (count / s)).
The check should probably be that the sum of the output image times the pixel size divided by 3631 is equal to the flux after conversion to Janskies, if that makes sense?
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.
Some very minor suggestions inline, but good to go, thanks!
This PR greatly reduces the code (and loop) duplication of level 3 source injection. Updates were made to the image source injection and the test. The l3 test was moved from test_image to test l3. Support code was added to wcs and parameters.
NOTE: The l3 and l3_test import blocks are large due to other PRs happening simultaneously.