Mantid Configuration#
The Mantid
framework is often used for powder diffraction beamlines at ORNL for data processing and other general purposes. Here in this page, we are posting some useful configurations for Mantid
(the Python interface or Mantid Workbench
).
On ORNL Analysis, the Python interface for the Mantid framework can be access on terminal via mantidpython
, mantidpythonqa
or mantidpythonnightly
, for the production release version, the release candidate and the nightly development version, respectively. Similarly for the Mantid Workbench
, the launching commands are mantidworkbench
, mantidworkbenchqa
and mantidworkbenchnightly
.
In case of the central deployed versions mentioned above are not working properly, one can temporarily use the local version deployed in the local conda environment of Dr. Yuanpeng Zhang. For Mantid Workbench
, the command to execute would be mantidl
(see also here.) For the Python interface, there is no local version yet. If needed, please get in touch with Dr. Yuanpeng Zhang so I can set it up. One can also refer to the instructions here if they want to set this up on their own.
Data Plot Setting#
In Mantid, for data plotting, we have an option to control whether or not to normalize the data at the plotting time. This is an option applied at the data plotting time, meaning that the data is not changed at all but only the visualization is changed. What this option does is to normalize the data by bin width for the plotting purpose. This option applies when plotting histogram data and through the normalization at the plotting time, the data presented in the plot would be converted to a distribution data, i.e., the bin width is divided out. If the data to be plotted is already a distribution data and we still have this option active, the already bin-width-normalized data will be divided by the bin width again, causing some weird behavior in the data presentation. For GSAS data, the stored data in the file would be histogram data. When Mantid loads in the data with, e.g., LoadGSS algorithm, the histogram data would be converted to distribution data automatically. Though, it should be noticed that the generated workspace would still say that the data is not a distribution data. In this case, if we still apply the option for bin width normalization at the plotting time, we would have the double division issue. Since we are having a logarithmic binning for the time-of-flight data, the bin width goes smaller and smaller as approaching the low TOF region. Therefore, the data got divided by a smaller and smaller number as approaching the low-TOF region, causing the background rocketing that we visually see while plotting.
Notes on GSAS-II and Topas
GSAS-II and Topas are two typical software used for diffraction data analysis and they are perfect examples for demonstrating the attention one may need to pay regarding the data being in the histogram or distribution mode. GSAS-II takes in histogram data
and it will convert the data into the distribution form, i.e., dividing the data by the bin width, internally. So, if one sees the data scaling being different between a direct plot of the Bragg data file in the GSAS form and the one inside GSAS-II, it should not come as a surprise. Topas instead takes in distribution data
and therefore it is assuming the data it loads in should already be in the distribution form. If not, Topas will anyhow treat the data as a distribution data, which then for sure will cause problems in the data fitting.
In the following video, I will demonstrate how to turn on/off the option in Mantid Workbench
.
from IPython.display import YouTubeVideo
YouTubeVideo('YuG2ay69r1g', width=720, height=500)