forked from TAMU-CLASS/barnfire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetendf.py
executable file
·34 lines (27 loc) · 994 Bytes
/
getendf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /usr/bin/env python
'''
Andrew Till
Summer 2014
Gets ENDF vii1 XS from T2's site.
For thermal XS, see http://t2.lanl.gov/nis/data/data/ENDFB-VII-thermal/UinUO2' etc.
'''
class Nuclide:
def __init__(self, name, Z, A):
self.name = name
self.Z = Z
self.A = A
nuclideList = []
nuclideList.append(Nuclide('Pu',94,241))
nuclideList.append(Nuclide('Pu',94,242))
nuclideList.append(Nuclide('U',92,233))
# Print out a list of work to do
with open('../dat/endf/work_items.txt', 'w') as fid:
for nuclide in nuclideList:
outname = 'endf_{0}{1}_vii1'.format(nuclide.Z, nuclide.A)
fid.write('wget http://t2.lanl.gov/nis/data/data/ENDFB-VII.1-neutron/{0}/{1} -O {2}\n'.format(nuclide.name, nuclide.A, outname))
# Print out a script to do the work in parallel
with open('../dat/endf/get_xs.sh', 'w') as fid:
fid.write('#! /usr/bin/env bash\n')
fid.write('#wget endf files in parallel!\n')
fid.write('\n')
fid.write('cat work_items.txt | parallel\n')