Merge pull request #499 from wbinventor/mgxs-pandas-groups

Hotfix for group indices in MGXS Pandas DataFrames
This commit is contained in:
Paul Romano 2015-11-12 13:14:48 -06:00
commit 110ad16a8d
5 changed files with 1839 additions and 1830 deletions

1
.gitignore vendored
View file

@ -37,6 +37,7 @@ src/xml-fortran/xmlreader
# Test results error file
results_error.dat
inputs_error.dat
results_test.dat
# Test build files
tests/build/

View file

@ -1224,23 +1224,31 @@ class MGXS(object):
else:
df = df.drop('score', axis=1)
# Rename energy(out) columns
columns = []
if 'energy [MeV]' in df:
# Override energy groups bounds with indices
groups = np.arange(self.num_groups, 0, -1, dtype=np.int)
groups = np.repeat(groups, self.num_nuclides)
if 'energy [MeV]' in df and 'energyout [MeV]' in df:
df.rename(columns={'energy [MeV]': 'group in'}, inplace=True)
columns.append('group in')
if 'energyout [MeV]' in df:
df.rename(columns={'energyout [MeV]': 'group out'}, inplace=True)
columns.append('group out')
in_groups = np.tile(groups, self.num_subdomains)
in_groups = np.repeat(in_groups, self.num_groups)
df['group in'] = in_groups
# Loop over all energy groups and override the bounds with indices
template = '({0:.1e} - {1:.1e})'
bins = self.energy_groups.group_edges
for column in columns:
for i in range(self.num_groups):
group = template.format(bins[i], bins[i+1])
row_indices = df[column] == group
df.loc[row_indices, column] = self.num_groups - i
df.rename(columns={'energyout [MeV]': 'group out'}, inplace=True)
out_groups = np.tile(groups, self.num_subdomains * self.num_groups)
df['group out'] = out_groups
columns = ['group in', 'group out']
elif 'energyout [MeV]' in df:
df.rename(columns={'energyout [MeV]': 'group out'}, inplace=True)
in_groups = np.tile(groups, self.num_subdomains)
df['group out'] = in_groups
columns = ['group out']
elif 'energy [MeV]' in df:
df.rename(columns={'energy [MeV]': 'group in'}, inplace=True)
in_groups = np.tile(groups, self.num_subdomains)
df['group in'] = in_groups
columns = ['group in']
# Select out those groups the user requested
if groups != 'all':

View file

@ -1,49 +1,49 @@
material group in nuclide mean std. dev.
0 1 1 total 0.419289 0.01638 material group in nuclide mean std. dev.
0 1 1 total 0.07774 0.003273 material group in group out nuclide mean std. dev.
0 1 1 1 total 0.352665 0.015654 material group out nuclide mean std. dev.
0 1 1 total 1 0.119622 material group in nuclide mean std. dev.
0 2 1 total 0.247316 0.009562 material group in nuclide mean std. dev.
0 2 1 total 0 0 material group in group out nuclide mean std. dev.
0 2 1 1 total 0.244838 0.009996 material group out nuclide mean std. dev.
0 2 1 total 0 0 material group in nuclide mean std. dev.
0 3 1 total 0.409938 0.042262 material group in nuclide mean std. dev.
0 3 1 total 0 0 material group in group out nuclide mean std. dev.
0 3 1 1 total 0.403354 0.041386 material group out nuclide mean std. dev.
0 3 1 total 0 0 material group in nuclide mean std. dev.
0 4 1 total 0.344007 0.05352 material group in nuclide mean std. dev.
0 4 1 total 0 0 material group in group out nuclide mean std. dev.
0 4 1 1 total 0.340438 0.052067 material group out nuclide mean std. dev.
0 4 1 total 0 0 material group in nuclide mean std. dev.
0 5 1 total 0 0 material group in nuclide mean std. dev.
0 5 1 total 0 0 material group in group out nuclide mean std. dev.
0 5 1 1 total 0 0 material group out nuclide mean std. dev.
0 5 1 total 0 0 material group in nuclide mean std. dev.
0 6 1 total 0 0 material group in nuclide mean std. dev.
0 6 1 total 0 0 material group in group out nuclide mean std. dev.
0 6 1 1 total 0 0 material group out nuclide mean std. dev.
0 6 1 total 0 0 material group in nuclide mean std. dev.
0 7 1 total 0 0 material group in nuclide mean std. dev.
0 7 1 total 0 0 material group in group out nuclide mean std. dev.
0 7 1 1 total 0 0 material group out nuclide mean std. dev.
0 7 1 total 0 0 material group in nuclide mean std. dev.
0 8 1 total 0 0 material group in nuclide mean std. dev.
0 8 1 total 0 0 material group in group out nuclide mean std. dev.
0 8 1 1 total 0 0 material group out nuclide mean std. dev.
0 8 1 total 0 0 material group in nuclide mean std. dev.
0 9 1 total 0.751873 0.559701 material group in nuclide mean std. dev.
0 9 1 total 0 0 material group in group out nuclide mean std. dev.
0 9 1 1 total 0.695491 0.50757 material group out nuclide mean std. dev.
0 9 1 total 0 0 material group in nuclide mean std. dev.
0 10 1 total 0 0 material group in nuclide mean std. dev.
0 10 1 total 0 0 material group in group out nuclide mean std. dev.
0 10 1 1 total 0 0 material group out nuclide mean std. dev.
0 10 1 total 0 0 material group in nuclide mean std. dev.
0 11 1 total 0.457329 0.403578 material group in nuclide mean std. dev.
0 11 1 total 0 0 material group in group out nuclide mean std. dev.
0 11 1 1 total 0.446737 0.392775 material group out nuclide mean std. dev.
0 11 1 total 0 0 material group in nuclide mean std. dev.
0 12 1 total 0.574978 0.38864 material group in nuclide mean std. dev.
0 12 1 total 0 0 material group in group out nuclide mean std. dev.
0 12 1 1 total 0.559478 0.377512 material group out nuclide mean std. dev.
0 12 1 total 0 0
material group in nuclide mean std. dev.
0 1 1 total 0.419289 0.01638 material group in nuclide mean std. dev.
0 1 1 total 0.07774 0.003273 material group in group out nuclide mean std. dev.
0 1 1 1 total 0.352665 0.015654 material group out nuclide mean std. dev.
0 1 1 total 1 0.119622 material group in nuclide mean std. dev.
0 2 1 total 0.247316 0.009562 material group in nuclide mean std. dev.
0 2 1 total 0 0 material group in group out nuclide mean std. dev.
0 2 1 1 total 0.244838 0.009996 material group out nuclide mean std. dev.
0 2 1 total 0 0 material group in nuclide mean std. dev.
0 3 1 total 0.409938 0.042262 material group in nuclide mean std. dev.
0 3 1 total 0 0 material group in group out nuclide mean std. dev.
0 3 1 1 total 0.403354 0.041386 material group out nuclide mean std. dev.
0 3 1 total 0 0 material group in nuclide mean std. dev.
0 4 1 total 0.344007 0.05352 material group in nuclide mean std. dev.
0 4 1 total 0 0 material group in group out nuclide mean std. dev.
0 4 1 1 total 0.340438 0.052067 material group out nuclide mean std. dev.
0 4 1 total 0 0 material group in nuclide mean std. dev.
0 5 1 total 0 0 material group in nuclide mean std. dev.
0 5 1 total 0 0 material group in group out nuclide mean std. dev.
0 5 1 1 total 0 0 material group out nuclide mean std. dev.
0 5 1 total 0 0 material group in nuclide mean std. dev.
0 6 1 total 0 0 material group in nuclide mean std. dev.
0 6 1 total 0 0 material group in group out nuclide mean std. dev.
0 6 1 1 total 0 0 material group out nuclide mean std. dev.
0 6 1 total 0 0 material group in nuclide mean std. dev.
0 7 1 total 0 0 material group in nuclide mean std. dev.
0 7 1 total 0 0 material group in group out nuclide mean std. dev.
0 7 1 1 total 0 0 material group out nuclide mean std. dev.
0 7 1 total 0 0 material group in nuclide mean std. dev.
0 8 1 total 0 0 material group in nuclide mean std. dev.
0 8 1 total 0 0 material group in group out nuclide mean std. dev.
0 8 1 1 total 0 0 material group out nuclide mean std. dev.
0 8 1 total 0 0 material group in nuclide mean std. dev.
0 9 1 total 0.751873 0.559701 material group in nuclide mean std. dev.
0 9 1 total 0 0 material group in group out nuclide mean std. dev.
0 9 1 1 total 0.695491 0.50757 material group out nuclide mean std. dev.
0 9 1 total 0 0 material group in nuclide mean std. dev.
0 10 1 total 0 0 material group in nuclide mean std. dev.
0 10 1 total 0 0 material group in group out nuclide mean std. dev.
0 10 1 1 total 0 0 material group out nuclide mean std. dev.
0 10 1 total 0 0 material group in nuclide mean std. dev.
0 11 1 total 0.457329 0.403578 material group in nuclide mean std. dev.
0 11 1 total 0 0 material group in group out nuclide mean std. dev.
0 11 1 1 total 0.446737 0.392775 material group out nuclide mean std. dev.
0 11 1 total 0 0 material group in nuclide mean std. dev.
0 12 1 total 0.574978 0.38864 material group in nuclide mean std. dev.
0 12 1 total 0 0 material group in group out nuclide mean std. dev.
0 12 1 1 total 0.559478 0.377512 material group out nuclide mean std. dev.
0 12 1 total 0 0

View file

@ -1,121 +1,121 @@
material group in nuclide mean std. dev.
1 1 1 total 0.384379 0.01649
0 1 2 total 0.812087 0.07419 material group in nuclide mean std. dev.
1 1 1 total 0.02127 0.000894
0 1 2 total 0.69604 0.053458 material group in group out nuclide mean std. dev.
3 1 1 1 total 0.349924 0.016649
2 1 1 2 total 0.000173 0.000173
1 1 2 1 total 0.001948 0.001952
0 1 2 2 total 0.379607 0.040078 material group out nuclide mean std. dev.
1 1 1 total 1 0.119622
0 1 2 total 0 0.000000 material group in nuclide mean std. dev.
1 2 1 total 0.245043 0.008827
0 2 2 total 0.266458 0.052209 material group in nuclide mean std. dev.
1 2 1 total 0 0
0 2 2 total 0 0 material group in group out nuclide mean std. dev.
3 2 1 1 total 0.243657 0.009083
2 2 1 2 total 0.000000 0.000000
1 2 2 1 total 0.000000 0.000000
0 2 2 2 total 0.254787 0.055563 material group out nuclide mean std. dev.
material group in nuclide mean std. dev.
1 1 1 total 0.384379 0.01649
0 1 2 total 0.812087 0.07419 material group in nuclide mean std. dev.
1 1 1 total 0.02127 0.000894
0 1 2 total 0.69604 0.053458 material group in group out nuclide mean std. dev.
3 1 1 1 total 0.349924 0.016649
2 1 1 2 total 0.000173 0.000173
1 1 2 1 total 0.001948 0.001952
0 1 2 2 total 0.379607 0.040078 material group out nuclide mean std. dev.
1 1 1 total 1 0.119622
0 1 2 total 0 0.000000 material group in nuclide mean std. dev.
1 2 1 total 0.245043 0.008827
0 2 2 total 0.266458 0.052209 material group in nuclide mean std. dev.
1 2 1 total 0 0
0 2 2 total 0 0 material group in nuclide mean std. dev.
1 3 1 total 0.282277 0.037242
0 3 2 total 1.427320 0.247127 material group in nuclide mean std. dev.
1 3 1 total 0 0
0 3 2 total 0 0 material group in group out nuclide mean std. dev.
3 3 1 1 total 0.253967 0.036173
2 3 1 2 total 0.027273 0.001807
1 3 2 1 total 0.000000 0.000000
0 3 2 2 total 1.376527 0.240257 material group out nuclide mean std. dev.
0 2 2 total 0 0 material group in group out nuclide mean std. dev.
3 2 1 1 total 0.243657 0.009083
2 2 1 2 total 0.000000 0.000000
1 2 2 1 total 0.000000 0.000000
0 2 2 2 total 0.254787 0.055563 material group out nuclide mean std. dev.
1 2 1 total 0 0
0 2 2 total 0 0 material group in nuclide mean std. dev.
1 3 1 total 0.282277 0.037242
0 3 2 total 1.427320 0.247127 material group in nuclide mean std. dev.
1 3 1 total 0 0
0 3 2 total 0 0 material group in nuclide mean std. dev.
1 4 1 total 0.255723 0.051917
0 4 2 total 1.179767 0.229380 material group in nuclide mean std. dev.
1 4 1 total 0 0
0 4 2 total 0 0 material group in group out nuclide mean std. dev.
3 4 1 1 total 0.232978 0.049771
2 4 1 2 total 0.022281 0.002625
1 4 2 1 total 0.000000 0.000000
0 4 2 2 total 1.146809 0.222198 material group out nuclide mean std. dev.
0 3 2 total 0 0 material group in group out nuclide mean std. dev.
3 3 1 1 total 0.253967 0.036173
2 3 1 2 total 0.027273 0.001807
1 3 2 1 total 0.000000 0.000000
0 3 2 2 total 1.376527 0.240257 material group out nuclide mean std. dev.
1 3 1 total 0 0
0 3 2 total 0 0 material group in nuclide mean std. dev.
1 4 1 total 0.255723 0.051917
0 4 2 total 1.179767 0.229380 material group in nuclide mean std. dev.
1 4 1 total 0 0
0 4 2 total 0 0 material group in nuclide mean std. dev.
1 5 1 total 0 0
0 5 2 total 0 0 material group in nuclide mean std. dev.
1 5 1 total 0 0
0 5 2 total 0 0 material group in group out nuclide mean std. dev.
3 5 1 1 total 0 0
2 5 1 2 total 0 0
1 5 2 1 total 0 0
0 5 2 2 total 0 0 material group out nuclide mean std. dev.
0 4 2 total 0 0 material group in group out nuclide mean std. dev.
3 4 1 1 total 0.232978 0.049771
2 4 1 2 total 0.022281 0.002625
1 4 2 1 total 0.000000 0.000000
0 4 2 2 total 1.146809 0.222198 material group out nuclide mean std. dev.
1 4 1 total 0 0
0 4 2 total 0 0 material group in nuclide mean std. dev.
1 5 1 total 0 0
0 5 2 total 0 0 material group in nuclide mean std. dev.
1 6 1 total 0 0
0 6 2 total 0 0 material group in nuclide mean std. dev.
1 6 1 total 0 0
0 6 2 total 0 0 material group in group out nuclide mean std. dev.
3 6 1 1 total 0 0
2 6 1 2 total 0 0
1 6 2 1 total 0 0
0 6 2 2 total 0 0 material group out nuclide mean std. dev.
0 5 2 total 0 0 material group in nuclide mean std. dev.
1 5 1 total 0 0
0 5 2 total 0 0 material group in group out nuclide mean std. dev.
3 5 1 1 total 0 0
2 5 1 2 total 0 0
1 5 2 1 total 0 0
0 5 2 2 total 0 0 material group out nuclide mean std. dev.
1 5 1 total 0 0
0 5 2 total 0 0 material group in nuclide mean std. dev.
1 6 1 total 0 0
0 6 2 total 0 0 material group in nuclide mean std. dev.
1 7 1 total 0 0
0 7 2 total 0 0 material group in nuclide mean std. dev.
1 7 1 total 0 0
0 7 2 total 0 0 material group in group out nuclide mean std. dev.
3 7 1 1 total 0 0
2 7 1 2 total 0 0
1 7 2 1 total 0 0
0 7 2 2 total 0 0 material group out nuclide mean std. dev.
0 6 2 total 0 0 material group in nuclide mean std. dev.
1 6 1 total 0 0
0 6 2 total 0 0 material group in group out nuclide mean std. dev.
3 6 1 1 total 0 0
2 6 1 2 total 0 0
1 6 2 1 total 0 0
0 6 2 2 total 0 0 material group out nuclide mean std. dev.
1 6 1 total 0 0
0 6 2 total 0 0 material group in nuclide mean std. dev.
1 7 1 total 0 0
0 7 2 total 0 0 material group in nuclide mean std. dev.
1 8 1 total 0 0
0 8 2 total 0 0 material group in nuclide mean std. dev.
1 8 1 total 0 0
0 8 2 total 0 0 material group in group out nuclide mean std. dev.
3 8 1 1 total 0 0
2 8 1 2 total 0 0
1 8 2 1 total 0 0
0 8 2 2 total 0 0 material group out nuclide mean std. dev.
0 7 2 total 0 0 material group in nuclide mean std. dev.
1 7 1 total 0 0
0 7 2 total 0 0 material group in group out nuclide mean std. dev.
3 7 1 1 total 0 0
2 7 1 2 total 0 0
1 7 2 1 total 0 0
0 7 2 2 total 0 0 material group out nuclide mean std. dev.
1 7 1 total 0 0
0 7 2 total 0 0 material group in nuclide mean std. dev.
1 8 1 total 0 0
0 8 2 total 0 0 material group in nuclide mean std. dev.
1 9 1 total 0.504036 0.379624
0 9 2 total 1.687095 2.536622 material group in nuclide mean std. dev.
1 9 1 total 0 0
0 9 2 total 0 0 material group in group out nuclide mean std. dev.
3 9 1 1 total 0.504036 0.379624
2 9 1 2 total 0.000000 0.000000
1 9 2 1 total 0.000000 0.000000
0 9 2 2 total 1.417955 2.158027 material group out nuclide mean std. dev.
0 8 2 total 0 0 material group in nuclide mean std. dev.
1 8 1 total 0 0
0 8 2 total 0 0 material group in group out nuclide mean std. dev.
3 8 1 1 total 0 0
2 8 1 2 total 0 0
1 8 2 1 total 0 0
0 8 2 2 total 0 0 material group out nuclide mean std. dev.
1 8 1 total 0 0
0 8 2 total 0 0 material group in nuclide mean std. dev.
1 9 1 total 0.504036 0.379624
0 9 2 total 1.687095 2.536622 material group in nuclide mean std. dev.
1 9 1 total 0 0
0 9 2 total 0 0 material group in nuclide mean std. dev.
1 10 1 total 0 0
0 10 2 total 0 0 material group in nuclide mean std. dev.
1 10 1 total 0 0
0 10 2 total 0 0 material group in group out nuclide mean std. dev.
3 10 1 1 total 0 0
2 10 1 2 total 0 0
1 10 2 1 total 0 0
0 10 2 2 total 0 0 material group out nuclide mean std. dev.
0 9 2 total 0 0 material group in group out nuclide mean std. dev.
3 9 1 1 total 0.504036 0.379624
2 9 1 2 total 0.000000 0.000000
1 9 2 1 total 0.000000 0.000000
0 9 2 2 total 1.417955 2.158027 material group out nuclide mean std. dev.
1 9 1 total 0 0
0 9 2 total 0 0 material group in nuclide mean std. dev.
1 10 1 total 0 0
0 10 2 total 0 0 material group in nuclide mean std. dev.
1 11 1 total 0.302826 0.401311
0 11 2 total 1.006145 1.091638 material group in nuclide mean std. dev.
1 11 1 total 0 0
0 11 2 total 0 0 material group in group out nuclide mean std. dev.
3 11 1 1 total 0.275679 0.385676
2 11 1 2 total 0.027147 0.020009
1 11 2 1 total 0.000000 0.000000
0 11 2 2 total 0.957929 1.051959 material group out nuclide mean std. dev.
0 10 2 total 0 0 material group in nuclide mean std. dev.
1 10 1 total 0 0
0 10 2 total 0 0 material group in group out nuclide mean std. dev.
3 10 1 1 total 0 0
2 10 1 2 total 0 0
1 10 2 1 total 0 0
0 10 2 2 total 0 0 material group out nuclide mean std. dev.
1 10 1 total 0 0
0 10 2 total 0 0 material group in nuclide mean std. dev.
1 11 1 total 0.302826 0.401311
0 11 2 total 1.006145 1.091638 material group in nuclide mean std. dev.
1 11 1 total 0 0
0 11 2 total 0 0 material group in nuclide mean std. dev.
1 12 1 total 0.255933 0.268426
0 12 2 total 1.113345 0.988676 material group in nuclide mean std. dev.
1 12 1 total 0 0
0 12 2 total 0 0 material group in group out nuclide mean std. dev.
3 12 1 1 total 0.226310 0.254872
2 12 1 2 total 0.029622 0.017760
1 12 2 1 total 0.000000 0.000000
0 12 2 2 total 1.071690 0.958290 material group out nuclide mean std. dev.
0 11 2 total 0 0 material group in group out nuclide mean std. dev.
3 11 1 1 total 0.275679 0.385676
2 11 1 2 total 0.027147 0.020009
1 11 2 1 total 0.000000 0.000000
0 11 2 2 total 0.957929 1.051959 material group out nuclide mean std. dev.
1 11 1 total 0 0
0 11 2 total 0 0 material group in nuclide mean std. dev.
1 12 1 total 0.255933 0.268426
0 12 2 total 1.113345 0.988676 material group in nuclide mean std. dev.
1 12 1 total 0 0
0 12 2 total 0 0
0 12 2 total 0 0 material group in group out nuclide mean std. dev.
3 12 1 1 total 0.226310 0.254872
2 12 1 2 total 0.029622 0.017760
1 12 2 1 total 0.000000 0.000000
0 12 2 2 total 1.071690 0.958290 material group out nuclide mean std. dev.
1 12 1 total 0 0
0 12 2 total 0 0

File diff suppressed because it is too large Load diff