mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Rename scripts to all start with openmc-. Also added openmc.ace module.
This commit is contained in:
parent
3b5640fcb4
commit
4d2dbff8de
14 changed files with 15 additions and 14 deletions
|
|
@ -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
12
scripts/convert_binary.py → openmc/ace.py
Executable file → Normal 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
13
scripts/openmc-ascii-to-binary
Executable 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])
|
||||
Loading…
Add table
Add a link
Reference in a new issue