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 gamma intensity calculation #1496

Merged

Conversation

ahnaf-tahmid-chowdhury
Copy link
Member

@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury commented Aug 5, 2023

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

  • Current Behavior: The material.gammas() method incorrectly calculates and returns gamma intensities in [100*decays/s/atom].
  • New Behavior: After the fix, the method will correctly return gamma intensities in [decays/s/atom].

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.

@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury linked an issue Aug 11, 2023 that may be closed by this pull request
tests/test_material.py Outdated Show resolved Hide resolved
tests/test_material.py Show resolved Hide resolved
@gonuke gonuke merged commit 8a9ef72 into pyne:develop Aug 26, 2023
@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury deleted the Gamma-function---factor-100 branch August 26, 2023 14:27
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

Successfully merging this pull request may close these issues.

Documentation Gamma function - factor 100
3 participants