Skip to content

Commit

Permalink
Add spinw obj to spec for twin cases in fitspec #158
Browse files Browse the repository at this point in the history
  • Loading branch information
mducle committed Apr 25, 2024
1 parent 0c8bae0 commit 322ace4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions swfiles/@spinw/fitspec.m
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@
'tid',0,'optMem',param.optmem,'gtensor',any(obj.single_ion.g),'fid',0);
% calculate neutron scattering cross section
spec = sw_neutron(spec,'n',data.n,'pol',data.corr.type{1}(1) > 1);
if size(obj.twin.vol, 2) > 1
% Need to include the original SpinW for sw_egrid to handle twins correctly.
spec.obj = obj;
end
% bin the data along energy
try
spec = sw_egrid(spec,'component',data.corr,'Evect',param.Evect,'imagChk',param.imagChk);
Expand Down

0 comments on commit 322ace4

Please sign in to comment.