pace-neutrons / Horace

Horace is a suite of programs for the visualization and analysis of large datasets from time-of-flight neutron inelastic scattering spectrometers.
https://pace-neutrons.github.io/Horace/stable/
GNU General Public License v3.0
8 stars 5 forks source link

ubmat_proj #1591

Closed abuts closed 1 month ago

abuts commented 7 months ago

Horace-3 file was storing ubmatrix wich was describing connection between pixel coordinate system and image coordinate system in Horace-3

When Horace-4 founds Horace-3 data, it tries to restore line_proj from this ubmatrix. It takes b-matrix from lattice and u-matrix by dividing ubmatrix by b-matrix. From u-matrix is used to recover u and v (and w) vectors for line_proj.

Problem occurs when legacy data are aligned. u-matrix in this case is production of rotation matrix, defined by u,v vectors and alignment matrix. Horace-4 makes assumption about nature of u-matrix to separate u-matrix and alignment matrix but these assumptions are not 100% valid.

There are no generic way of separating these matices especially in nonorthogonal== true case.

The soulution to support aligned data is introducing ubmat_proj which would be identical to line_proj except being constructed from ub_matrix directly.

This would allow to use it for old data recovery and work alongside with line_proj and other projections without any constrain.

Additional benifit of this approach would be possibility to define projection from goniometer (or ubmatrix) directly if somebody needs it.

abuts commented 1 month ago

Done by #1592