From 59594fea70ae73eecab172b656e695d958d9a5dd Mon Sep 17 00:00:00 2001 From: Dan Short Date: Fri, 31 Jul 2020 11:48:53 +0100 Subject: [PATCH] Add copy of existing show_flux.py --- examples/serialized_custom_source/show_flux.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 examples/serialized_custom_source/show_flux.py diff --git a/examples/serialized_custom_source/show_flux.py b/examples/serialized_custom_source/show_flux.py new file mode 100644 index 0000000000..6f54943018 --- /dev/null +++ b/examples/serialized_custom_source/show_flux.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt +import openmc + +# Get the flux from the statepoint +with openmc.StatePoint('statepoint.10.h5') as sp: + flux = sp.tallies[1].mean + flux.shape = (50, 50) + +# Plot the flux +fig, ax = plt.subplots() +ax.imshow(flux, origin='lower', extent=(-5.0, 5.0, -5.0, 5.0)) +ax.set_xlabel('x [cm]') +ax.set_ylabel('y [cm]') +plt.show()