Changes are needed in the SPIND tab in order to make good use of it:
The existing text field "Output UB matrix" can be replaced by a table where all lines/solutions of the program are listed (one line per solution in spind.txt output file). Headers for the table are ‘label’ (column 1 of spin.txt), 'crystal ID' (column 2), ‘match rate’ (column 3), 'matched peaks' (column 4), 'UB matrix' (columns 6-14). I can't figure out what column 5 is now, we can keep it without label for the moment.
Clicking on any line of the above-described table should make that solution active and therefore outputs the corresponding calculated hkl values (in a new output text field maybe?), for all reflections corresponding to the input ROIs. The calculation of the h, k and l indices has to be done this way:
z1 = z1frmd(wave, ga, om, ch, ph, nu) is already calculated in pyzebra (z1frmd function is in xtal.py)
ub = np.transpose(spindub) where spindub is the matrix output from SPIND
ubinv = np.linalg.inv(ub)
@rsibille-psi , concerning the first point, could you provide an example of the input data that leads to multiple UB matrix solutions? Just need that for testing.
Changes are needed in the SPIND tab in order to make good use of it:
The existing text field "Output UB matrix" can be replaced by a table where all lines/solutions of the program are listed (one line per solution in spind.txt output file). Headers for the table are ‘label’ (column 1 of spin.txt), 'crystal ID' (column 2), ‘match rate’ (column 3), 'matched peaks' (column 4), 'UB matrix' (columns 6-14). I can't figure out what column 5 is now, we can keep it without label for the moment.
Clicking on any line of the above-described table should make that solution active and therefore outputs the corresponding calculated hkl values (in a new output text field maybe?), for all reflections corresponding to the input ROIs. The calculation of the h, k and l indices has to be done this way:
z1 = z1frmd(wave, ga, om, ch, ph, nu) is already calculated in pyzebra (z1frmd function is in xtal.py)
ub = np.transpose(spindub) where spindub is the matrix output from SPIND ubinv = np.linalg.inv(ub)
h = ubinv[0, 0] z1[0] + ubinv[0, 1] z1[1] + ubinv[0, 2] z1[2] k = ubinv[1, 0] z1[0] + ubinv[1, 1] z1[1] + ubinv[1, 2] z1[2] l = ubinv[2, 0] z1[0] + ubinv[2, 1] z1[1] + ubinv[2, 2] * z1[2]