Two main options:
- Download EXE files from last release (usually available for Linux and Windows x64)
- Download source files + install python with required libraries
This option offers the most simple use of the MCNP tally plotter. User needs to download and install basic Python 3 (not tested with releases older than 3.8). Current files are available in Releases at the main page.
Users can run binary files with following libraries:
- Python
- ttkwidgets
- openpyxl - pandas dependecy
- pandas
- matplotlib (release 0.8.3 and older works only with matplotlib <3.8 )
- pywin32 (Windows only)
Virtual environment is prefered option how to install necessary libraries (Conda, virtualenv, etc.). Program has to be started by running following command:
python mcnp_tally_plot_main.py
- this plotter was created for quick and efficient visualization of 2D tally data extracted from MCNP output files,
- despite different codes, this one has a Graphical User Interface and allows doing some basic plot modifications,
- tested with some simple tally results from MCNPX, 6.1, 6.2 and 6.3, does NOT support mctal (planned), mdata, meshtal and runtpe files,
- MCNP Tools package for more advanced tally loading will be included in the near future (mctal support),
- you can find a full description in the sections below,
- simple XS data might be shown together with tally data (all XS were obtained from IAEA ENDF webpage) - this is a temporary solution, in the future, there will be a possibility to use show XS data from MCNP ACE files.
- this window is shown immediately after the program start
- list of options:
- Choose directory - will open a dialog for work directory selection. Program read all
outputfiles in thi directory and ignore all non MCNP files - Update directory - this option read again content of work directory.
- Plot data - all selected tallies are plotted in a new window.
- Export tally to xlsx - all selected tally are saved to
.xslsfile. User has to choose the.xslsfile name in the saving dialog. All tally are saved into single sheet. - (un)check all - this function is activated by left mouse button by clicking on column name (un)check all. It checks or unchecks all tallies in the list.
- sort by column - this function is activated by left mouse button by clicking on column name. It sorts all tallies by the selected column.
- Choose directory - will open a dialog for work directory selection. Program read all
- the table in the main window contains several columns which are shown after the first output file is read:
- the first column is check box for data selection
- File - is a unique identifier created from output file name and tally number
- Tally number - tally number from output file
- Tally type - shows a tally type from output file
- Particle - tally particle
- Number of values - number of values in the tally
- E_cut-off (MeV) - energy cut off is taken from the output cut off table if was printed or default value is used (default values are taken from the MCNP manual). Cut off energy is put before first energy in the tally results.
- E_min (MeV) - lowest energy from the tally
- E_max (MeV) - highest energy from the tally
- comment - tally comment if was defined by user
- the main parts of the plot window:
- figure section - shows data selected in the main window and edited by section 2. and 3.
- plotter settings - this section allows some basic changes. A more detailed description is below.
- figure tools - allows manual zoom by magnifier tool, move in changes back and forward, modify position of titles and plot, move curves in the figure and save plot into several formats.
- most of the plot settings are applied instantly.
- this behavior could be deactivated by check box in bottom part of the window (Replot frame). Then, all changes are applied with button Replot.
- A Quit button could be used for a return to the main window.
A brief description of major settings:
- some settings are not available after the Plotting window is opened. The activation depends on availability of appropriate dataset(s).
- Axis scale frame allows to change axes scale between linear and logarithmic options
- Data input frame offers several optins
- data normalization per 1 MeV (data are divided by energy bins). Default data are normalized.
- show/hide error bars might be useful in a case of worse statistics when a figure is saturated by error bars.
- show/hide first bin might be useful to hide value between cut-off energy and first tally bin (if the first tally energy bin does not start with the zero/cut-off value then the MCNP is capturing values in this energy range).
- a menu button in Data input frame allows choosing a tally for ratio plot. All other tallies are divided by the selected tally. This works only if all tallies in the plot have the same bins.
- Legend setting frame - allows change legend position and font size.
- Legend editor button opens a new window with text editor for a
config_legendfile modifications. User can change datasets labels in the plot legend.
- Legend editor button opens a new window with text editor for a
- Font size frame - allows change Axes labels and Ticks font size.
- Grid settings frame - allows to turn on/off a grid with different settings.
- Save frame allows store a figure with specific dimensions and DPI. LaTeX option is not available right now.
- Cross-section (XS) frame allows showing XS data in the picture with a secondary Y axis. Options connected to XS are activated when user uploads XS data
- Settings frame - allows open and modify
config_exportfile. This file stores all current options chosen by user in GUI window and some options which are availabel only through configuration file. Functions available in config file (this might change in time):- a text of axes labels
- text used in the figure title (has to be activated by user - default off)
- Reload config button - read again setting from the
configfile (in case users made changes in an external text editor)
- Axes limits allows to change minimum and maximum values of all axes.
Nonevalue is used if user wants let the plotter chose these values automatically. Changes might be applied by hittingEnterkey when the cursor is active in an entry box.
- Editor settings/legend from Export frame opens a new window depending on a menu button above this button
- there are two options:
- config_export - this file content wide option for figure editing. It includes axis title names and min/max values, figure export parameters (dpi, file extension), etc. Default value for all variables is
None - config_legend - in this file are stored all tallies during the read process if they are not already here. Users can change the file name used in the figure legend by editing string behind equal symbol.
- config_export - this file content wide option for figure editing. It includes axis title names and min/max values, figure export parameters (dpi, file extension), etc. Default value for all variables is
- the graph is reploted automatically when the user saves the config file and closes the editor window
- in the current state is supported only a specific format of XS data from the IAEA ENDF webpage
- in this database are available, all main evaluated databases and their older versions
- the user has to select and plot all required data. In the plotter page is possible to download all plotted data (red circle in the picture below)
- the MCNP plotter can show data only from one file. Therefore, all XS values must be in one file.
- as a control sequence is used
#symbol. Only data where is#removed from name string will be plotted. - a string following a tally name is used as a name in figure legend.
The compilation was performed using the PyInstaller package within a venv environment, along with the necessary libraries required by the plotter. Below are the exact settings used for compiling on both Linux and Windows.
A venv environment was chosen instead of conda to reduce the size of the final executable. This is because conda often installs a large number of optional libraries that are not needed, resulting in a significantly larger output.
pyinstaller mcnp_tally_plot_main.py \
--onefile \
--noconsole \
--hiddenimport=matplotlib.backends.backend_pdf \
--hiddenimport=matplotlib.backends.backend_svg \
--hiddenimport=matplotlib.backends.backend_ps
pyinstaller mcnp_tally_plot_main.py \
--onefile \
--noconsole \
--hiddenimport=matplotlib.backends.backend_pdf \
--hiddenimport=matplotlib.backends.backend_svg \
--hiddenimport=matplotlib.backends.backend_ps \
--hidden-import=PIL._tkinter_finder
pyinstaller mcnp_tally_plot_main.py \
--onefile \
--noconsole \
--hidden-import=matplotlib.backends.backend_pdf \
--hidden-import=matplotlib.backends.backend_svg \
--hidden-import=matplotlib.backends.backend_ps \
--hidden-import=PIL._tkinter_finder
