Skip to content

Commit

Permalink
Merge branch 'endf_photon' of https://github.com/crbates/pyne into cr…
Browse files Browse the repository at this point in the history
…bates-endf_photon
  • Loading branch information
scopatz committed Dec 16, 2014
2 parents d6bd51f + 3537165 commit 37cd1c6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ tests/test.file
tests/test.txt
tests/U235.txt
tests/Ni59.txt
tests/Zn.txt
tutorial/Ni59.txt
docs/rxname_listing
.ipynb_checkpoints
Expand Down
5 changes: 4 additions & 1 deletion pyne/endf.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,10 @@ class Library(rx.RxLib):
nuc = nucname.id(nuc)
if nuc_i == None:
nuc_i = nuc
xsdata = self.get_rx(nuc, 3, mt).reshape(-1,6)
if 600 > mt > 500:
xsdata = self.get_rx(nuc, 23, mt).reshape(-1,6)
else:
xsdata = self.get_rx(nuc, 3, mt).reshape(-1,6)
total_lines = 0
head_flags = self._get_head(('ZA','AWR',0,0,0,0),
xsdata[total_lines])
Expand Down
28 changes: 28 additions & 0 deletions tests/test_endf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ def test_int_loglog_only_interpolate_one_endpoint():
exp = e/3 * (5**3 - 2 **3) / (5-2)
assert_allclose(exp, obs, rtol=1e-12)


def test_discretize():
from os.path import isfile
try:
Expand Down Expand Up @@ -1029,5 +1030,32 @@ def test_discretize():
312.62178192130619, 590.40136068709603, 724.64216445611373]
assert_array_almost_equal(nonelastic_c, exp)


def test_photoatomic():
try:
assert(os.path.isfile('Zn.txt'))
except AssertionError:
try:
import urllib.request as urllib
except ImportError:
import urllib
urllib.urlretrieve("https://www-nds.iaea.org/fendl30/data/atom/endf/ph_3000_30-Zn.txt",
"Zn.txt")
photondata = Library('Zn.txt')
xs_data = photondata.get_xs(300000000, 501)[0]
Eints, sigmas = xs_data['e_int'], xs_data['xs']
assert_equal(len(Eints),1864)
assert_equal(len(sigmas),1864)
assert_array_equal(Eints[0:5],[1., 1.109887, 1.217224,
1.2589, 1.334942])
assert_array_equal(Eints[-5:],[6.30960000e+10, 7.94328000e+10,
7.94330000e+10, 8.00000000e+10,
1.00000000e+11])
assert_array_almost_equal(sigmas[0:5],[0.00460498, 0.00710582,
0.01047864, 0.01210534,
0.01556538])
assert_array_almost_equal(sigmas[-5:],[ 6.71525 , 6.716781, 6.716781,
6.716829, 6.717811])

if __name__ == "__main__":
nose.runmodule()

0 comments on commit 37cd1c6

Please sign in to comment.