Spice_icon SPICE
Spectrometer Instrument Control Environment


ubcalc:

The ubcalc command calculates the UB matrix.

The syntax for the ubcalc command is:

     ubcalc mode   

OR

     ubcalc n1 n2 n3 n4 n5 n6 n7 n8 n9   

OR

     ubcalc file path


where mode is:
1. define scattering plane vectors, a single reflection, and the lattice constants.
2. define 2 non-colinear reflections are the lattice constants.
3. linear least-squares refinement of the orientation and lattice constants.

n1-n9 are read as the 9 elements of the 3x3 UB matrix array - this option should only be used by advanced users.
The file option reads from a UB matrix configuration file.  This can be used to restore an old orientation and is used extensively in the GUI.



Calculation of the UB matrix can also be accomplished from the GUI by selecting the UB Matrix tab from the Sample top-level tab. The mode is selected from the blue pull-down menu.  The options for the mode are:
     1. Define scattering plane vector and 1 reflection
     2. Define 2 non-colinear reflections
     3. Refine UB (3 non-coplanar reflections required) (shown in the image below).  
To recalculate the UB matrix using the selected mode, hit the blue Calculate UB Matrix Update Orientation Information button. This will result in a popup box where the results of the UB matrix calculation are presented (an example is shown in the lower image). The user can then choose to accept the calculation or CANCEL.

NOTE: the orientation information is easier to modify from the GUI than from the command-line as it allows the user to preview the orientation information prior to accepting the changes.  The ubcalc command should only be executed from the command-line by experienced users as it could yield unexpected results.  For detailed information about entering orientation information from the GUI see the How to align a single crystal guide.

GUI interface to ubcalc input


Output from ubcalc