This section gives an ultra-brief overview of how to use McXtrace 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
Template_1Slit_Diff.instr file supplied in the examples/Templates directory of the
McXtrace distribution.
To start the graphical user interface of McXtrace, run the mxgui command which will open
a window with a number of menus, see figure 5.1.
To load an instrument, select “New from Template” (formerly known as the “X-ray Site”
menu) and open the template/example Template_1Slit_Diff. Next, check that the current
plotting backend setting (“Preferences” in the File menu, or the --autoplotter option of
mxrun) corresponds to your system setup:
by editing the user configuration file, see mxrun --edit-user-config,
or by setting the MCXTRACE_FORMAT environment variable.
Next, select “Run simulation” from the “Simulation” menu. The McXtrace compiler
mcxtrace will translate the definition into an executable program. Then mxgui 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 5.4.6. For other options, execute
mxplot --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 mxdisplay front-end (section 5.4.5), again using one of the matplotlib, pyqtgraph or webGL back-ends.
For a slightly longer gentle introduction to McXtrace, see the McXtrace tutorial (available
from [Mcx]), and as of version 3.10.4 built into the mxgui help menu. For more technical
details, read on from section 5.2