mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Fixed issue with plotting nuclides with divisor types
This commit is contained in:
parent
27c07b02d6
commit
14e3684a6a
1 changed files with 4 additions and 12 deletions
|
|
@ -116,20 +116,12 @@ def plot_xs(this, types, divisor_types=None, temperature=294., axis=None,
|
|||
# grid, and then do the actual division
|
||||
Enum = E[:]
|
||||
E = np.union1d(Enum, Ediv)
|
||||
if data_type == 'nuclide':
|
||||
data_new = []
|
||||
else:
|
||||
data_new = np.zeros((len(types), len(E)))
|
||||
data_new = np.zeros((len(types), len(E)))
|
||||
|
||||
for line in range(len(types)):
|
||||
if data_type == 'nuclide':
|
||||
data_new.append(openmc.data.Combination([data[line],
|
||||
data_div[line]],
|
||||
[np.divide]))
|
||||
else:
|
||||
data_new[line, :] = \
|
||||
np.divide(np.interp(E, Enum, data[line, :]),
|
||||
np.interp(E, Ediv, data_div[line, :]))
|
||||
data_new[line, :] = \
|
||||
np.divide(np.interp(E, Enum, data[line, :]),
|
||||
np.interp(E, Ediv, data_div[line, :]))
|
||||
if divisor_types[line] != 'unity':
|
||||
types[line] = types[line] + ' / ' + divisor_types[line]
|
||||
data = data_new
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue