diff --git a/horace_core/utilities/@MagneticIons/getFF_calculator.m b/horace_core/utilities/@MagneticIons/getFF_calculator.m index 04419efac6..32db718357 100644 --- a/horace_core/utilities/@MagneticIons/getFF_calculator.m +++ b/horace_core/utilities/@MagneticIons/getFF_calculator.m @@ -44,14 +44,25 @@ % if isa(win,'sqw') - self.hkl_to_Qmat_ = win.data.proj.bmatrix(); + self.proj_ = win.data.proj; elseif isnumeric(win) || all(size(win) == [3,3]) - self.hkl_to_Qmat_= win; + proj = line_proj([1,0,0], [0,1,0]); + % Uses the identity: + % inv(B^T * B) = [aa ab.cos(gamma) ac.cos(beta); + % ab.cos(gamma) bb bc.cos(alpha); + % ac.cos(beta) bc.cos(alpha) cc]; + bb = inv(win' * win); + alatt = sqrt(diag(bb)); + angdeg(1) = acos(bb(2,3) / prod(alatt(2:3))); + angdeg(2) = acos(bb(1,3) / prod(alatt([1 3]))); + angdeg(3) = acos(bb(1,2) / prod(alatt(1:2))); + proj.alatt = 2*pi * alatt; + proj.angdeg = angdeg * 180 / pi; + self.proj_ = proj; else - self.hkl_to_Qmat_ = win.proj.bmatrix(); + self.proj_ = win.proj; end - fint = @(h,k,l,en,argi)form_factor(self,h,k,l,en,argi);