Created
May 13, 2016 18:32
-
-
Save pshriwise/82e510ae3a858f26a20a3affb7ae1ddf to your computer and use it in GitHub Desktop.
python script used to add a total source intensity tag from an expanded r2s step 2 source .h5m. Raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyne.mesh import Mesh,IMeshTag | |
import numpy as np | |
import sys | |
m = Mesh(sys.argv[1]) | |
m.source_density_total = IMeshTag(size=1, dtype=float) | |
total = np.array(m.source_density_total[:]) | |
for name, tag in m.tags.items(): | |
if "source_density_" in name: | |
total += np.array(tag[:]) | |
m.source_density_total[:] = total[:] | |
fout = sys.argv[1].split(".") | |
m.mesh.save(fout[0]+"_w_total.vtk") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment