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

Fix a bug where errors could happen in chromatic drawing when realized flux is 0. #1317

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

rmjarvis
Copy link
Member

@sidneymau reported a bug where very low flux objects being drawn with chromatic photon shooting could error rather than just not draw anything.

The bug stemmed from having both 0 photons and each photon having a flux of 0 (the g parameter returned by calculate_nphotons). This is overkill and confused one of the calculations in the chromatic draw function. In case there are other bits of code that similarly assume the raw flux is sensible even if nphotons=0, I changed the calculate_nphotons function to return g=1 when iN=0.

@rmjarvis rmjarvis added bug report Bug report chromatic Related to the Chromatic classes, SEDs, bandpasses, etc. labels Oct 31, 2024
@rmjarvis rmjarvis added this to the v2.6 milestone Oct 31, 2024
@rmjarvis rmjarvis merged commit d821c2f into releases/2.6 Dec 2, 2024
10 checks passed
@rmjarvis rmjarvis deleted the low_flux_phot branch December 2, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug report chromatic Related to the Chromatic classes, SEDs, bandpasses, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant