diff --git a/swfiles/@spinw/fitspec.m b/swfiles/@spinw/fitspec.m index 1e55545d0..fb7f6882d 100644 --- a/swfiles/@spinw/fitspec.m +++ b/swfiles/@spinw/fitspec.m @@ -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);