Skip to content
jessicahunter24 edited this page Apr 17, 2013 · 15 revisions

All of the plots seen so far in this guide have been from PINSPEC's plotter module. PINSPEC has a wide range of plotting features to allow users to visualize their input and output data. All plotting functions are written in python and included in the python module plotter. Therefore, all plotting functions must be prefaced with plotter.. The plotting capabilities include:

  • Microscopic Cross Sections
  • Macroscopie Cross Sections
  • Flux
  • Thermal Scattering Kernels
  • Fission Emission Spectrum
  • Resonance Integrals
  • Group Cross Sections
  • Planar Slice (of geometry)

Below is a the code used to plot the flux for the infinite homogeneous case:

>>> plotter.plotFlux(flux, loglog=True, uselegend=False, filename='flux', title='Infinite medium flux')

This function produces the following plot:

As shown above, the plotFlux function takes in five inputs. These inputs help specify characteristics including plot scaling, whether a legend should be included, what the plot file should be called, and the title included on the plot. To make the user's job easier, the last four inputs and defaults and thus do not need to be included with every function call.

Below is a the code used to plot flux, cross sections, and thermal scattering kernels for the homogeneous equivalence case. It is shown as a script to demonstrate the format of continuing long lines in python scripts, as well as comment formatting.

    # Plotting xs, flux, thermal scattering
    plotter.plotFlux([total_flux, moderator_flux, fuel_flux], output_dir)
    plotter.plotMicroXS(u235, ['capture', 'elastic', 'fission'], output_dir)
    plotter.plotMicroXS(u238, ['capture', 'elastic', 'fission'], output_dir)
    plotter.plotMicroXS(h1, ['capture', 'elastic', 'absorption'], output_dir)
    plotter.plotMicroXS(o16, ['capture', 'elastic', 'absorption'], output_dir)
    plotter.plotMacroXS(fuel, ['capture', 'elastic', 'fission', \
                                            'absorption', 'total'], output_dir)
    plotter.plotMacroXS(moderator, ['capture', 'elastic', 'fission', \
                                            'absorption', 'total'], output_dir)

    plotter.plotThermalScattering(h1, output_dir)
    plotter.plotThermalScattering(u238, output_dir)
    plotter.plotThermalScattering(u235, output_dir)
    plotter.plotThermalScattering(o16, output_dir)

As shown in the two examples, the plotFlux function can take in a single flux tally or a list of flux tallies as its first input.

The macroscopic cross section plots for the fuel (left) and moderator(right) are included below:

Other plotting functions include plotFissionSpectrum(), plotRI(), plotGroupXS(), plotSlice() and plotFissionSourceDist(). The details of these options can be found in the documentation.

Tutorials

Home

Clone this wiki locally