From c88615bdd7032194ce478392db17b0fd2c2efb2b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 18 Nov 2012 14:28:57 -0500 Subject: [PATCH] Ability to plot 2D mesh tallies. --- src/utils/statepoint_meshplot.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils/statepoint_meshplot.py b/src/utils/statepoint_meshplot.py index 4fa21b6fdf..2420bc33dd 100755 --- a/src/utils/statepoint_meshplot.py +++ b/src/utils/statepoint_meshplot.py @@ -47,11 +47,16 @@ for t in sp.tallies: if 'mesh' not in t.filters: continue - # Get Mesh object + # Get Mesh object and determine size m = sp.meshes[t.filters['mesh'].bins[0] - 1] - nx, ny, nz = m.dimension - ns = t.total_score_bins * t.total_filter_bins / (nx*ny*nz) + if len(m.dimension) == 2: + nx, ny = m.dimension + nz = 1 + else: + nx, ny, nz = m.dimension + # Calculate number of score bins + ns = t.total_score_bins * t.total_filter_bins / (nx*ny*nz) assert n_bins == nx*ny*nz*ns # Create lists for tallies