If an UB matrix exist, it is read by /online_dir/exp_ini.exp. Otherwise there are several ways for setting it up:
The lattice parameters are read from the menu, and the 2 sets of reflections are taken to be the 2 uppermost ones in the list of reflections.
The calculations is based on the assumption that the positions for the first of the reflections in the list have been correctly determined, while the second reflection is used only to determine an angle (the length of the secondary reflection is thus allowed to error). On return the algorithm delivers a new UB matrix. The algorithm assumes internally that the offset angles are 0, but it leaves the offset unchanged in the menu. In order not to get inconsistencies, offsets should therefore be 0 throughout, or the two reflections in the list should be properly re-calibrated.
In order to do so, a list of reflections has to be provided. (See section 7.8 for details about how to center a reflection and store the results.)
A proper input file rafin.dat for RAFIN can be created and edited by KP_MINUS. The rafin.dat file has to be edited: At least one should specify whether wavelength, zero offsets and/or lattice parameters should be refined (set the appropriate flags to 0 or 1). For further editing of the first line in the file, specifying number of iterations etc., see the RAFIN manual.
Once the input file has been created, RAFIN can be started by KP7. Direct the output to a file. Following a successful refinement RAFIN will create files rafin.lpt and ubfrom.raf. Inspection of rafin.lpt can be done by KP9. If you are satisfied with the results PF2 creates a new UB matrix, a new set of offset angles and a new wavelength. In order to see the new lattice parameters press PF1. In order to apply the new wavelength as the actual wavelength to be used for setting motor positions calibrate the energy in the move/mc menu.
The refinement program RAFIN has been modified to allow for weights on , and observations, and will prompt for the weights.