Skip to content

Commit

Permalink
add examples/standard_studies/std201/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gschnabel committed Nov 17, 2023
1 parent cfaad3e commit ffaedab
Show file tree
Hide file tree
Showing 18 changed files with 229,939 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/standard_studies/std2017/Standards2017_TNC.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Table 11. Thermal Neutron Constants (cross sections and average total neutron yield) for fissile actinides for neutrons with energy 0.0253 eV.
# The 0.4 % unrecognized systematic uncertainty is included in the uncertainties of the total neutron yields (nu-bar).
#
Quantity U3 U3-UNC U5 U5-UNC PU9 PU9-UNC PU1 PU1-UNC
SF 533.0 2.2 587.3 1.4 752.4 2.2 1023.6 10.8
SG 44.9 0.9 99.5 1.3 269.8 2.5 362.3 6.1
SS 12.2 0.7 14.09 0.22 7.8 1.0 11.9 2.6
# Nu-bar, Total average
# neutron yield
# per 1 fission 2.487+-0.011 2.425+-0.011 2.878+-0.013 2.940+-0.013
# Total average neutron yield per 1 fission in Cf-252(sf) 3.764+-0.016
105,126 changes: 105,126 additions & 0 deletions examples/standard_studies/std2017/explore_mcmc_problem.ipynb

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions examples/standard_studies/std2017/helperfuns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import pandas as pd
import numpy as np


def translate_to_absreacs(reacs):
absreacs = []
for reac in reacs:
if reac.startswith('MT:2-'):
absreac = 'MT:1-' + reac[5:]
elif reac.startswith('MT:4-'):
absreac = 'MT:3-' + reac[5:]
elif reac.startswith('MT:8-'):
absreac = 'MT:5-' + reac[5:]
elif reac.startswith('MT:9-'):
absreac = 'MT:7-' + reac[5:]
else:
absreac = reac
absreacs.append(absreac)
return np.array(absreacs)


def renormalize_data(priortable, exptable, priorvals, expvals):
renorm_vals = np.array(expvals)
expids = exptable.loc[exptable.REAC.str.match('MT:[2489]-'), 'NODE'].unique()
for expid in expids:
norm_node = 'norm_' + expid[4:]
norm_index = priortable.index[priortable.NODE == norm_node]
if len(norm_index) != 1:
raise IndexError(
f'exactly one normalization error must be present for {expid}'
)
norm_index = norm_index[0]
norm_fact = priorvals[norm_index]
exp_idcs = exptable.index[exptable.NODE == expid]
renorm_vals[exp_idcs] /= norm_fact
return renorm_vals


import sys
sys.path.append('../../..')
from gmapy.data_management.object_utils import load_objects

priortable, exptable, is_adj = load_objects('../../tensorflow/example-005/output/01_model_preparation_output.pkl', 'priortable', 'exptable', 'is_adj')
optres, = load_objects('../../tensorflow/example-005/output/02_parameter_optimization_output.pkl', 'optres')
red_priortable = priortable[is_adj].reset_index(drop=True)

renorm_data = renormalize_data(red_priortable, exptable, optres.position.numpy(), exptable.DATA)
absreacs = translate_to_absreacs(exptable.REAC)

exptable['ABSREAC'] = absreacs
exptable['RENORM_DATA'] = renorm_data












Loading

0 comments on commit ffaedab

Please sign in to comment.