solutions list and hkl calculation in SPIND tab #22

Closed
opened 2021-01-20 18:06:05 +01:00 by usov_i · 2 comments
usov_i commented 2021-01-20 18:06:05 +01:00 (Migrated from gitlab.psi.ch)

Created by: rsibille-psi

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]

*Created by: rsibille-psi* 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]
usov_i commented 2021-02-02 11:21:22 +01:00 (Migrated from gitlab.psi.ch)

Created by: ivan-usov

@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.

*Created by: ivan-usov* @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.
usov_i commented 2021-02-02 11:52:27 +01:00 (Migrated from gitlab.psi.ch)

Created by: rsibille-psi

spind.txt

*Created by: rsibille-psi* [spind.txt](https://github.com/paulscherrerinstitute/pyzebra/files/5910572/spind.txt)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: zebra/pyzebra#22
No description provided.