StollLab / EasySpin

MATLAB toolbox for Electron Paramagnetic Resonance (EPR) spectroscopy
http://easyspin.org
MIT License
48 stars 26 forks source link

Reverse how crystal orientation in lab is specified #245

Closed stestoll closed 1 year ago

stestoll commented 2 years ago

Currently, one needs to provide the relative orientation between crystal and lab frame by providing in Exp.CrystalOrientation the Euler angles that describe the transformation of the crystal frame to the lab frame.

This means that the specifications of relative frame orientations are lab<--crystal-->molecular-->tensor. This is inconsistent. It would be more consistent to use lab-->crystal-->molecular-->tensor. Then, one provides Euler angles that transform the lab frame to the crystal frame, which is also more intuitive: you start with the crystal frame aligned with the lab frame, and then rotate it until the crystal frame is in the desired orientation. The user point of view stays grounded in the lab frame. This is also consistent with the other frame transformations: to specify the molecular frame, one starts with the crystal frame, and to specify the tensor orientations, one starts with the molecular frame.

To implement this, one needs to make Exp.CrystalOrientation obsolete (or error when it is encountered) and use something like Exp.CrystalFrame for the new convention.

Separate from this, but related, is the issue of naming. Should there be a CrystalFrame if there is no crystal, but say a oriented film?

stestoll commented 1 year ago

It could be named Exp.SampleFrame - this would be a reasonable term for both crystals and films.