Skip to content

Commit

Permalink
Fix getFF_calculator for Horace4
Browse files Browse the repository at this point in the history
  • Loading branch information
mducle committed Jul 26, 2024
1 parent 59ea5a8 commit 1175260
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions horace_core/utilities/@MagneticIons/getFF_calculator.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);


0 comments on commit 1175260

Please sign in to comment.