mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Some remaining updats to make from merge...
This commit is contained in:
parent
a3b87ad372
commit
378d4fc090
2 changed files with 19 additions and 1 deletions
|
|
@ -9,7 +9,8 @@ from openmc.checkvalue import check_type, check_iterable_type, \
|
|||
check_greater_than, _isinstance
|
||||
|
||||
_FILTER_TYPES = ['universe', 'material', 'cell', 'cellborn', 'surface',
|
||||
'mesh', 'energy', 'energyout', 'distribcell']
|
||||
'mesh', 'energy', 'energyout', 'mu', 'polar', 'azimuthal',
|
||||
'distribcell']
|
||||
|
||||
class Filter(object):
|
||||
"""A filter used to constrain a tally to a specific criterion, e.g. only tally
|
||||
|
|
|
|||
|
|
@ -1278,6 +1278,23 @@ class Tally(object):
|
|||
filter_bins = np.tile(filter_bins, tile_factor)
|
||||
df[filter.type + ' [MeV]'] = filter_bins
|
||||
|
||||
# mu, polar, and azimuthal
|
||||
elif filter.type in ['mu', 'polar', 'azimuthal']:
|
||||
bins = filter.bins
|
||||
num_bins = filter.num_bins
|
||||
|
||||
# Create strings for
|
||||
template = '{0:1.2f} - {1:1.2f}'
|
||||
filter_bins = []
|
||||
for i in range(num_bins):
|
||||
filter_bins.append(template.format(bins[i], bins[i+1]))
|
||||
|
||||
# Tile the mu bins into a DataFrame column
|
||||
filter_bins = np.repeat(filter_bins, filter.stride)
|
||||
tile_factor = data_size / len(filter_bins)
|
||||
filter_bins = np.tile(filter_bins, tile_factor)
|
||||
df[filter.type] = filter_bins
|
||||
|
||||
# universe, material, surface, cell, and cellborn filters
|
||||
else:
|
||||
filter_bins = np.repeat(filter.bins, filter.stride)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue