Ejemplo n.º 1
0
# 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...")
for t in sp.tallies:
    # Calculate t-value for 95% two-sided CI
    n = t.n_realizations
    t_value = scipy.stats.t.ppf(0.975, n - 1)
Ejemplo n.º 2
0
# 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...")
for t in sp.tallies:
    # Calculate t-value for 95% two-sided CI
    n = t.n_realizations
    t_value = scipy.stats.t.ppf(0.975, n - 1)