A monte carlo pin cell spectral code for nuclear engineering applications.
|
The plotter module provides utility functions to plot data from PINSPEC's C++ classes, in particular, tally data and cross-sections, thermal scattering PDFs/CDFs, etc. More...
Functions | |
def | plotMicroXS |
Plots the microscopoic cross-section(s) for one or more reaction rates for an isotope. More... | |
def | plotMacroXS |
Plots the macroscopic cross-section(s) for one or more reaction rates for a material. More... | |
def | plotFlux |
Plots one or more flux tallies by energy. More... | |
def | plotThermalScattering |
Plots the thermal scattering PDFs and CDFs for an isotope. More... | |
def | plotFissionSpectrum |
Plots the fission spectrum PDF and CDF. More... | |
def | plotRI |
Plots a resonance integral (RIEff or RITrue) as a step function. More... | |
def | plotGroupXS |
Plots a multi-group cross-section as a step function. More... | |
def | plotSlice |
This method takes in a region or a geometry object and plots a color-coded 2D surface plot representing a planar slice through the space. More... | |
def | plotFissionSourceDist |
Plots a vector field of the fission site source distribution. More... | |
def | trackANeutron |
This method takes in a geometry class object and tracks a neutron as it travels across the geomgetry. More... | |
Variables | |
int | flux_plot_num = 0 |
A static variable to auto-generate unique filenames for flux plots. | |
string | subdirectory = "/plots/" |
A static variable for the output directory in which to save plots. | |
The plotter module provides utility functions to plot data from PINSPEC's C++ classes, in particular, tally data and cross-sections, thermal scattering PDFs/CDFs, etc.
def pinspec.plotter.plotFissionSourceDist | ( | geometry, | |
num_samples = 1000 , |
|||
filename = '' |
|||
) |
Plots a vector field of the fission site source distribution.
geometry | a HETEROGENEOUS geometry class object |
num_samples | an optional number of samples |
filename | an optional filename |
def pinspec.plotter.plotFissionSpectrum | ( | ) |
Plots the fission spectrum PDF and CDF.
This method generates and saves the plot as a *.png in the plotting output directory. A user may invoke this function from a PINSPEC Python file as follows:
def pinspec.plotter.plotFlux | ( | fluxes, | |
loglog = True , |
|||
uselegend = False , |
|||
title = '' , |
|||
filename = '' |
|||
) |
Plots one or more flux tallies by energy.
This method generates and saves the plot as a *.png in the plotting output directory. A user may invoke this function from a PINSPEC Python file as follows:
fluxes | the flux tall(ies) of interest |
loglog | an optional argument boolean to use a log-log scale |
uselegend | an optional argument boolean to include a legend |
title | an optional argument string with the plot title |
filename | an optional argument string with the plot filename |
def pinspec.plotter.plotGroupXS | ( | group_xs, | |
title = '' , |
|||
filename = '' |
|||
) |
Plots a multi-group cross-section as a step function.
This method generates and saves the plot as a *.png in the plotting output directory. A user may invoke this function from a PINSPEC Python file as follows:
def pinspec.plotter.plotMacroXS | ( | material, | |
rxns, | |||
loglog = True , |
|||
uselegend = True , |
|||
title = '' , |
|||
filename = '' |
|||
) |
Plots the macroscopic cross-section(s) for one or more reaction rates for a material.
This method generates and saves the plot as a *.png in the plotting output directory. A user may invoke this function from a PINSPEC Python file as follows:
material | the material of interest |
rxns | an array of reaction rate types (ie, ['capture, 'elastic']) |
loglog | an optional argument to use a log-log scale |
uselegend | an optional argument boolean to include a legend |
title | an optional argument string with the plot title |
filename | an optional argument string with the plot filename |
def pinspec.plotter.plotMicroXS | ( | isotope, | |
rxns, | |||
loglog = True , |
|||
uselegend = True , |
|||
title = '' , |
|||
filename = '' |
|||
) |
Plots the microscopoic cross-section(s) for one or more reaction rates for an isotope.
This method generates and saves the plot as a *.png in the plotting output directory. A user may invoke this function from a PINSPEC Python file as follows:
isotope | the isotope of interest |
rxns | an array of reaction rate types (ie, ['capture, 'elastic']) |
loglog | an optional argument to use a log-log scale |
uselegend | an optional argument boolean to include a legend |
title | an optional argument string with the plot title |
filename | an optional argument string with the plot filename |
def pinspec.plotter.plotRI | ( | RI, | |
title = '' , |
|||
filename = '' |
|||
) |
Plots a resonance integral (RIEff or RITrue) as a step function.
This method generates and saves the plot as a *.png in the plotting output directory. A user may invoke this function from a PINSPEC Python file as follows:
def pinspec.plotter.plotSlice | ( | space, | |
plane = 'XY' , |
|||
loc = 0.0 , |
|||
lim1 = [-2. , |
|||
lim2 = [-2. , |
|||
gridsize = 100 , |
|||
filename = '' |
|||
) |
This method takes in a region or a geometry object and plots a color-coded 2D surface plot representing a planar slice through the space.
space | a bounded region or heterogeneous geometry object |
plane | the optional 'xy', 'xz' or 'yz' plane the user wishes to plot |
loc | the optional x, y, or z position of the planar plot |
lim1 | the optional bounding limits for the first planar dimension |
lim2 | the optional bounding limits for the second planar dimension |
gridsize | an optional number of grid cells for the plot |
filename | an optional filename |
def pinspec.plotter.plotThermalScattering | ( | isotope, | |
uselegend = True , |
|||
title = '' , |
|||
filename = '' |
|||
) |
Plots the thermal scattering PDFs and CDFs for an isotope.
This method generates and saves the plot as a *.png in the plotting output directory. A user may invoke this function from a PINSPEC Python file as follows:
isotope | the isotope of interest |
uselegend | an optional argument boolean to include a legend |
title | an optional argument string with the plot title |
filename | an optional argument string with the plot filename |
def pinspec.plotter.trackANeutron | ( | geometry, | |
plane = 'XY' , |
|||
num_moves = 100 , |
|||
loc = 0.0 , |
|||
lim1 = [-2. , |
|||
lim2 = [-2. , |
|||
gridsize = 100 , |
|||
filename = '' |
|||
) |
This method takes in a geometry class object and tracks a neutron as it travels across the geomgetry.
A color-coded 2D surface plot representing a planar slice through the space is produced as the backdrop to a series of line segments representing a neutron's path across the pin cell.
geometry | a heterogeneous geometry object |
plane | the optional 'xy', 'xz' or 'yz' plane the user wishes to plot |
num_moves | the number of neutron moves across the geometry to plot |
loc | the optional x, y, or z position of the planar plot |
lim1 | the optional bounding limits for the first planar dimension |
lim2 | the optional bounding limits for the second planar dimension |
gridsize | an optional number of grid cells for the plot |
filename | an optional filename |