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

Convert counts to integer to avoid floating point weirdness. #119

Merged
merged 1 commit into from
May 3, 2024

Conversation

schlafly
Copy link
Collaborator

@schlafly schlafly commented May 3, 2024

This PR clips the number of photons entering a pixel over an exposure to 2 * 10**9 to avoid floating point / integer math issues. This seems like a lot of photons, but a 0th mag star should generate O(10^11) photons per second per meter squared, so it's not that many. Roman saturates at O(10^5) photons and we really only need to care about handling enough to saturate in a single read; this lets us handle exposure times up to ~2*10^4 reads which seems like more than enough. The non-linearity correction will have issues long before this and would be the next thing to look at if we wanted to do a better job with very bright stars.

@schlafly schlafly requested a review from a team as a code owner May 3, 2024 13:53
Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.73%. Comparing base (725b7cb) to head (103d9c2).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
- Coverage   92.44%   90.73%   -1.71%     
==========================================
  Files          16       16              
  Lines        1509     1630     +121     
==========================================
+ Hits         1395     1479      +84     
- Misses        114      151      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@schlafly schlafly merged commit 6a98ffb into spacetelescope:main May 3, 2024
19 of 20 checks passed
@schlafly schlafly deleted the cap-counts branch May 3, 2024 14:20
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.

1 participant