Rename scripts to all start with openmc-. Also added openmc.ace module.

This commit is contained in:
Paul Romano 2015-05-22 16:59:47 +07:00
parent 3b5640fcb4
commit 4d2dbff8de
14 changed files with 15 additions and 14 deletions

View file

@ -21,8 +21,8 @@ except ImportError:
from urllib2 import urlopen
cwd = os.getcwd()
sys.path.append(os.path.join(cwd, '..', 'src', 'utils'))
from convert_binary import ascii_to_binary
sys.path.insert(0, os.path.join(cwd, '..'))
from openmc.ace import ascii_to_binary
baseUrl = 'http://www.nndc.bnl.gov/endf/b7.1/aceFiles/'
files = ['ENDF-B-VII.1-neutron-293.6K.tar.gz',

12
scripts/convert_binary.py → openmc/ace.py Executable file → Normal file
View file

@ -1,9 +1,5 @@
#!/usr/bin/env python
from __future__ import division
from struct import pack
import sys
def ascii_to_binary(ascii_file, binary_file):
@ -67,11 +63,3 @@ def ascii_to_binary(ascii_file, binary_file):
# Close binary file
binary.close()
if __name__ == '__main__':
# Check for proper number of arguments
if len(sys.argv) < 3:
sys.exit('Usage: {0} ascii_file binary_file'.format(sys.argv[0]))
# Convert ASCII file
ascii_to_binary(sys.argv[1], sys.argv[2])

13
scripts/openmc-ascii-to-binary Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env python
from openmc.ace import ascii_to_binary
import sys
if __name__ == '__main__':
# Check for proper number of arguments
if len(sys.argv) < 3:
sys.exit('Usage: {0} ascii_file binary_file'.format(sys.argv[0]))
# Convert ASCII file
ascii_to_binary(sys.argv[1], sys.argv[2])