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

minor error in photon_check #513

Closed
Higginbottom opened this issue May 8, 2019 · 0 comments
Closed

minor error in photon_check #513

Higginbottom opened this issue May 8, 2019 · 0 comments

Comments

@Higginbottom
Copy link
Collaborator

I've been trying to debug a problem with py_pluto and was concerned to see that I was getting the error

photon_checks: 10000 of 10000 or 1.000000e+02 per cent of photons failed checks

on further investigation, I discovered only one or two photons were ending up with negative frequencies. This is bad, and I'll see what is going on, but there arent 100% of photons failing.

The reason for the exaggerated error message is a small error on line 1469 of photon_gen.c:

if (nnn == 0)
Debug ("photon_checks: All photons passed checks successfully\n");
else
{
Log ("photon_checks: %d of %d or %e per cent of photons failed checks\n", nn, NPHOT, nn * 100. / NPHOT);
}

nnn is a counter for photons that have errored. So the log should be

Log ("photon_checks: %d of %d or %e per cent of photons failed checks\n", nnn, NPHOT, nnn * 100. / NPHOT);

otherwise it doesn't matter how many error, the report always says 100% have errored.
Fiuxing...

Higginbottom added a commit to Higginbottom/python that referenced this issue May 8, 2019
Higginbottom added a commit that referenced this issue May 8, 2019
fixed minor bug #513 - reporting duff photons
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

No branches or pull requests

2 participants