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

Open
wants to merge 1 commit into
base: releases/2.6
Choose a base branch
from

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
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