spacetelescope / romanisim

Nancy Grace Roman Space Telescope WFI Data Simulator
https://romanisim.readthedocs.io
Other
15 stars 13 forks source link

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

Closed schlafly closed 4 months ago

schlafly commented 4 months ago

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 ~210^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.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.