Skip to content

Instantly share code, notes, and snippets.

@gidden
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save gidden/733928213c1dae70a456 to your computer and use it in GitHub Desktop.

Select an option

Save gidden/733928213c1dae70a456 to your computer and use it in GitHub Desktop.
Trying to make Kaeri-like plots
from pyne.endf import Library
from pyne import nucname as nn
import matplotlib.pyplot as plt
import os
from urllib import urlretrieve
nucs = ['U235']
nmt = 18 # for (z, fission)
for nuc in nucs:
f = '{}.txt'.format(nuc)
if not os.path.isfile(f):
root = "http://t2.lanl.gov/nis/data/data/ENDFB-VII.1-neutron"
pth = "/".join([root, nn.zz_name[nn.znum(nuc)], str(nn.anum(nuc))])
urlretrieve(pth, f)
fig = plt.figure()
for nuc in nucs:
lib = Library('{}.txt'.format(nuc))
data = lib.get_xs(nn.id(nuc), nmt)[0]
x, y = data['e_int'], data['xs']
plt.step(x, y, where='pre', label=nuc, figure=fig)
plt.xscale('log')
plt.yscale('log')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment