pyne / pyne

PyNE: The Nuclear Engineering Toolkit
http://pyne.io/
Other
261 stars 176 forks source link

Fix gamma intensity calculation #1496

Closed ahnaf-tahmid-chowdhury closed 9 months ago

ahnaf-tahmid-chowdhury commented 10 months ago

Description

This PR addresses the issue "Documentation Gamma function - factor 100 #1433". The problem was related to the material.gammas() method, which incorrectly calculates the intensity of gamma rays, returning the value in [100*decays/s/atom] instead of the expected [decays/s/atom].

Motivation and Context

The current material.gammas() method in pyne misrepresents the intensity of gamma rays, leading to incorrect results when used in calculations involving specific activity. This PR aims to fix the intensity calculation and ensure that the method returns gamma intensities in the correct units.

Changes

This PR introduces a fix to the material.gammas() method in the material.cpp file. The code has been updated to divide the raw gamma intensity values by 100 to correct the unit representation. With this fix, the method will now return gamma intensities in [decays/s/atom] as documented.

Behavior

Other Information

To verify the correctness of the changes, I ran tests with the isotope Cs-137, using an intensity value of 84.99% obtained from nucleide.org. The results now match the expected values, confirming the correction.

from pyne.material import Material
Material({'Cs-137': .8499}).gammas()

Output: [(283.5, 4.2351778792770854e-15), (661.657, 6.214028233215172e-10)]

image

Changelog file

This PR also includes an update to the CHANGELOG file. I created a new entry describing the change and referenced this pull request number for easy tracking.