dkriegner / xrayutilities

xrayutilities - a package with useful scripts for X-ray diffraction physicists
http://xrayutilities.sourceforge.io
GNU General Public License v2.0
81 stars 29 forks source link

allow setting of a "reference frame" in Experiment classes #98

Open dkriegner opened 4 years ago

dkriegner commented 4 years ago

Currently Experiment.Ang2Q (by default) converts the angular goniometer positions to a Q-coordinate frame fixed to the innermost goniometer circle, but using the laboratory coordinate system.

Ang2HKL (with appropriate parameters) can directly convert the angular positions to HKL values.

There is a third, currently somehow hidden intermediate step: a coordinate system fixed to the surface orientation of the crystal. By introducing a new parameter: "reference_frame" to Ang2Q a user could select the level of conversion he wishes to get.

dkriegner commented 3 years ago

Its also important to note that for Experiment.Ang2Q the two parameters of its constructor idir and ndir are not needed. This confuses many people which only use Ang2Q. When using the reference_frame='laboratory' then these two parameters can be omitted. Also the code should be more flexible and allow the user to specify a U or UB matrix instead of these two directions which are used automatically in Ang2Q or Ang2HKL when the reference_frame='sample' or reference_frame='crystal' are used.

dkriegner commented 3 years ago

One could also think of removing Ang2HKL and incorporate all functionality in Ang2Q. In fact Ang2HKL already now is only a wrapper around Ang2Q. This would make all use a bit simpler and also avoid the dettype parameter of Ang2HKL!