A monte carlo pin cell spectral code for nuclear engineering applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pinspec.plotter Namespace Reference

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.
 

Detailed Description

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.

Author
Samuel Shaner (shane.nosp@m.r@mi.nosp@m.t.edu)
William Boyd (wboyd.nosp@m.@mit.nosp@m..edu
Date
March 10, 2013

Function Documentation

def pinspec.plotter.plotFissionSourceDist (   geometry,
  num_samples = 1000,
  filename = '' 
)

Plots a vector field of the fission site source distribution.

Parameters
geometrya HETEROGENEOUS geometry class object
num_samplesan optional number of samples
filenamean 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:

1 pinspec.plotter.plotFlux(my_flux, title='one flux')
2 pinspec.plotter.plotFlux([flux1, flux2], title='two fluxes')
Parameters
fluxesthe flux tall(ies) of interest
loglogan optional argument boolean to use a log-log scale
uselegendan optional argument boolean to include a legend
titlean optional argument string with the plot title
filenamean 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:

1 pinspec.plotter.plotMacroXS(my_material, 'capture')
Parameters
materialthe material of interest
rxnsan array of reaction rate types (ie, ['capture, 'elastic'])
loglogan optional argument to use a log-log scale
uselegendan optional argument boolean to include a legend
titlean optional argument string with the plot title
filenamean 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:

1 pinspec.plotter.plotMicroXS(my_isotope, 'capture')
Parameters
isotopethe isotope of interest
rxnsan array of reaction rate types (ie, ['capture, 'elastic'])
loglogan optional argument to use a log-log scale
uselegendan optional argument boolean to include a legend
titlean optional argument string with the plot title
filenamean 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:

1 pinspec.plotter.plotRI(my_resonance_integral)
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.

Parameters
spacea bounded region or heterogeneous geometry object
planethe optional 'xy', 'xz' or 'yz' plane the user wishes to plot
locthe optional x, y, or z position of the planar plot
lim1the optional bounding limits for the first planar dimension
lim2the optional bounding limits for the second planar dimension
gridsizean optional number of grid cells for the plot
filenamean 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:

Parameters
isotopethe isotope of interest
uselegendan optional argument boolean to include a legend
titlean optional argument string with the plot title
filenamean 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.

Parameters
geometrya heterogeneous geometry object
planethe optional 'xy', 'xz' or 'yz' plane the user wishes to plot
num_movesthe number of neutron moves across the geometry to plot
locthe optional x, y, or z position of the planar plot
lim1the optional bounding limits for the first planar dimension
lim2the optional bounding limits for the second planar dimension
gridsizean optional number of grid cells for the plot
filenamean optional filename