import matplotlib.pyplot as plt from statepoint import StatePoint # Get filename filename = argv[1] # Determine axial level axial_level = int(argv[2]) if len(argv) > 2 else 1 score = int(argv[3]) if len(argv) > 3 else 1 # Create StatePoint object sp = StatePoint(filename) # Read number of realizations for global tallies sp.n_realizations = sp._get_int()[0] # Read global tallies n_global_tallies = sp._get_int()[0] sp.global_tallies = np.array(sp._get_double(2 * n_global_tallies)) sp.global_tallies.shape = (n_global_tallies, 2) # Flag indicating if tallies are present tallies_present = sp._get_int()[0] # Check if tallies are present if not tallies_present: raise Exception("No tally data in state point!") # Loop over all tallies print("Reading data...")
from sys import argv from math import sqrt import numpy as np import scipy.stats import matplotlib import matplotlib.pyplot as plt from statepoint import StatePoint # Create StatePoint object sp1 = StatePoint('without-ufs.state') sp2 = StatePoint('with-ufs.state') sp1._get_int() sp2._get_int() # Calculate t-value for 95% two-sided CI n = sp1.current_batch - sp1.n_inactive t_value = scipy.stats.t.ppf(0.975, n - 1) ################################ WITHOUT UFS ################################### for t in sp1.tallies: n_bins = t.n_score_bins * t.n_filter_bins i_mesh = [f.type for f in t.filters].index('mesh') # Get Mesh object m = sp1.meshes[t.filters[i_mesh].bins[0] - 1] nx, ny, nz = m.dimension ns = t.n_score_bins * t.n_filter_bins / (nx*ny*nz)
import matplotlib.pyplot as plt from statepoint import StatePoint # Get filename filename = argv[1] # Determine axial level axial_level = int(argv[2]) if len(argv) > 2 else 1 score = int(argv[3]) if len(argv) > 3 else 1 # Create StatePoint object sp = StatePoint(filename) # Read number of realizations for global tallies sp.n_realizations = sp._get_int()[0] # Read global tallies n_global_tallies = sp._get_int()[0] sp.global_tallies = np.array(sp._get_double(2*n_global_tallies)) sp.global_tallies.shape = (n_global_tallies, 2) # Flag indicating if tallies are present tallies_present = sp._get_int()[0] # Check if tallies are present if not tallies_present: raise Exception("No tally data in state point!") # Loop over all tallies print("Reading data...")
from sys import argv from math import sqrt import numpy as np import scipy.stats import matplotlib import matplotlib.pyplot as plt from statepoint import StatePoint # Create StatePoint object sp1 = StatePoint('without-ufs.state') sp2 = StatePoint('with-ufs.state') sp1._get_int() sp2._get_int() # Calculate t-value for 95% two-sided CI n = sp1.current_batch - sp1.n_inactive t_value = scipy.stats.t.ppf(0.975, n - 1) ################################ WITHOUT UFS ################################### for t in sp1.tallies: n_bins = t.n_score_bins * t.n_filter_bins i_mesh = [f.type for f in t.filters].index('mesh') # Get Mesh object m = sp1.meshes[t.filters[i_mesh].bins[0] - 1] nx, ny, nz = m.dimension ns = t.n_score_bins * t.n_filter_bins / (nx * ny * nz)