Skip to content

Instantly share code, notes, and snippets.

View paulromano's full-sized avatar

Paul Romano paulromano

View GitHub Profile
@paulromano
paulromano / convert_source_element.py
Created July 30, 2012 21:22
Convert <source> element to new format for OpenMC settings.xml files
#!/usr/bin/env python
import sys
# Check that path was supplied
if len(sys.argv) < 2:
print("Must supply path to settings.xml!")
sys.exit(1)
# Get path to settings.xml and name of new file
@paulromano
paulromano / convert_ace_endian.py
Created February 28, 2013 16:05
Convert endianness for ACE format cross sections
#!/usr/bin/python
import sys
from struct import pack, unpack
# Get name of original ACE file
filename = sys.argv[1]
# Open unconverted and converted files
aceOld = open(filename, 'rb')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulromano
paulromano / convert_ace_binary.py
Last active August 29, 2015 13:58
Convert an ACE file in ASCII format (Type 1) to binary format (Type 2)
#!/usr/bin/env python
from __future__ import division
from struct import pack
import sys
def ascii_to_binary(ascii_file, binary_file):
"""Convert an ACE file in ASCII format (type 1) to binary format (type 2).
@paulromano
paulromano / EnergyDistribution.ipynb
Created April 11, 2014 03:31
Example of plotting fission secondary energy distribution
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulromano
paulromano / Hexagonal lattice example.ipynb
Created May 10, 2016 16:16
Hexagonal lattice example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulromano
paulromano / Hexagon region.ipynb
Created May 17, 2016 14:36
Example of openmc.make_hexagon_region()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.