From fb0dbfe5d2e8d55199c0bdeca9d45c0135105d9c Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Wed, 18 Jan 2017 19:55:56 -0500 Subject: [PATCH] Saving changes before looking at num_polar/azimuthal defaulting to 1 --- docs/source/io_formats/mgxs_library.rst | 12 +++++++----- openmc/mgxs/mdgxs.py | 9 +++------ openmc/mgxs/mgxs.py | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/source/io_formats/mgxs_library.rst b/docs/source/io_formats/mgxs_library.rst index 46c6b1839..942c50305 100644 --- a/docs/source/io_formats/mgxs_library.rst +++ b/docs/source/io_formats/mgxs_library.rst @@ -90,7 +90,7 @@ Temperature-dependent data, provided for temperature K. :Datasets: - **total** (*double[]* or *double[][][]*) -- Total cross section. This is a 1-D vector if `representation` is "isotropic", or a 3-D vector if `representation` is "angle" with dimensions of - [groups][azimuthal][polar]. + [polar][azimuthal][groups]. - **absorption** (*double[]* or *double[][][]*) -- Absorption cross section. This is a 1-D vector if `representation` is "isotropic", or a 3-D @@ -100,19 +100,19 @@ Temperature-dependent data, provided for temperature K. cross section. This is a 1-D vector if `representation` is "isotropic", or a 3-D vector if `representation` is "angle" with dimensions of - [groups][azimuthal][polar]. This is only required if the dataset + [polar][azimuthal][groups]. This is only required if the dataset is fissionable and fission-tallies are expected to be used. - **kappa-fission** (*double[]* or *double[][][]*) -- Kappa-Fission (energy-release from fission) cross section. This is a 1-D vector if `representation` is "isotropic", or a 3-D vector if `representation` is "angle" with dimensions of - [groups][azimuthal][polar]. This is only required if the dataset + [polar][azimuthal][groups]. This is only required if the dataset is fissionable and fission-tallies are expected to be used. - **chi** (*double[]* or *double[][][]*) -- Fission neutron energy spectra. This is a 1-D vector if `representation` is "isotropic", or a 3-D vector if `representation` is "angle" with dimensions of - [groups][azimuthal][polar]. This is only required if the dataset + [polar][azimuthal][groups]. This is only required if the dataset is fissionable and fission-tallies are expected to be used. - **nu-fission** (*double[]* to *double[][][][]*) -- Nu-Fission cross section. @@ -124,7 +124,9 @@ Temperature-dependent data, provided for temperature K. same dimensionality as `multiplicity matrix`. - **inverse-velocity** (*double[]* or *double[][][]*) -- Average inverse velocity for each of the groups in the library. - This dataset is optional. + This dataset is optional. This is a 1-D vector if `representation` + is "isotropic", or a 3-D vector if `representation` is "angle" + with dimensions of [polar][azimuthal][groups]. **//K/scatter_data/** diff --git a/openmc/mgxs/mdgxs.py b/openmc/mgxs/mdgxs.py index 57cf6c401..ff917d4e9 100644 --- a/openmc/mgxs/mdgxs.py +++ b/openmc/mgxs/mdgxs.py @@ -408,9 +408,9 @@ class MDGXS(MGXS): else: num_delayed_groups = len(delayed_groups) - # Reshape tally data array with separate axes for domain, energy groups, - # delayed groups, and nuclides - # Accomodate the polar and azimuthal bins if needed + # Reshape tally data array with separate axes for domain, + # energy groups, delayed groups, and nuclides + # Accommodate the polar and azimuthal bins if needed if self.num_polar or self.num_azimuthal: if self.num_polar: num_pol = self.num_polar @@ -852,7 +852,6 @@ class MDGXS(MGXS): if self.by_nuclide and nuclides == 'sum': # Use tally summation to sum across all nuclides - query_nuclides = [nuclides] xs_tally = self.xs_tally.summation(nuclides=self.get_nuclides()) df = xs_tally.get_pandas_dataframe( distribcell_paths=distribcell_paths) @@ -865,14 +864,12 @@ class MDGXS(MGXS): # If the user requested a specific set of nuclides elif self.by_nuclide and nuclides != 'all': - query_nuclides = nuclides xs_tally = self.xs_tally.get_slice(nuclides=nuclides) df = xs_tally.get_pandas_dataframe( distribcell_paths=distribcell_paths) # If the user requested all nuclides, keep nuclide column in dataframe else: - query_nuclides = self.nuclides df = self.xs_tally.get_pandas_dataframe( distribcell_paths=distribcell_paths) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 672b882cd..c321ea902 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -1760,7 +1760,6 @@ class MGXS(object): if self.by_nuclide and nuclides == 'sum': # Use tally summation to sum across all nuclides - query_nuclides = [nuclides] xs_tally = self.xs_tally.summation(nuclides=self.get_nuclides()) df = xs_tally.get_pandas_dataframe( distribcell_paths=distribcell_paths) @@ -4332,6 +4331,7 @@ class ScatterMatrixXS(MatrixMGXS): dont_squeeze = (1, 2, 3) else: dont_squeeze = (1, 2) + # Squeeze will return a ValueError if the axis has a size # greater than 1, so try each axis in axes one at a time, # and do our own check to preclude the ValueError