McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding

Download
 Components
 Other Downloads (share)

Mailing list

Search web/mailinglist

Documentation
 Wiki (GitHub)
 McStas manual
 Publications

Links

Report bugs (GitHub)

Code-repository (GitHub)


Brief introduction to the graphical user interface

3.2  Brief introduction to the graphical user interface

This section gives an ultra-brief overview of how to use McStas once it has been properly installed. It is intended for those who do not read manuals if they can avoid it. For details on the different steps, see the following sections. This section uses the BNL_H8.instr file supplied in the examples/BNL/BNL_H8 directory of the McStas distribution.

To start the graphical user interface of McStas, run the mcgui command which will open a window with a number of menus, see figure 3.2.


PIC


Figure 3.2.: The graphical user interface mcgui.


To load an instrument, select “New from Template” (formerly known as the “Neutron site” menu) and open the template/example BNL/BNL_H8. Next, check that the current plotting backend setting (“Preferences” in the File menu, or the --autoplotter option of mcrun) corresponds to your system setup:

  • by editing the user configuration file, see mcrun --edit-user-config,

Next, select “Run simulation” from the “Simulation” menu. The McStas compiler mcstas will translate the definition into an executable program. Then mcgui will pop up a dialog window. Type a value for the “ROT” parameter (e.g. 90), check the “Plot results” option, and select “Start”. The simulation will run, and when it finishes after a while the results will be plotted in a window, using one of the Python plotting back-ends (matplotlib, pyqtgraph or an HTML/browser view), see section 3.5.6. For other options, execute mcplot --help to get help.

To visualize or debug the simulation graphically, repeat the steps but check the “Trace” option instead of the “Simulate” option. A window will pop up showing a sketch of the instrument, drawn by the mcdisplay front-end (section 3.5.5), again using one of the matplotlib, pyqtgraph or webGL back-ends.

For a slightly longer gentle introduction to McStas, see the McStas tutorial (available from [Mcsa]), and as of version 3.9 built into the mcgui help menu. For more technical details, read on from section 3.3


Last Modified: Tuesday, 06-Oct-2026 21:19:11 CEST
Search website mailinglist archive GitHub repos