Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More usability improvements sw fitpowder (DRAFT IN PROG) #210

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Handle edges/nans properly in avg. of error when taking 1D cuts
  • Loading branch information
RichardWaiteSTFC committed Jan 9, 2025
commit 2869cff75d201485b44129d505ee88f0aa5d0c41
3 changes: 2 additions & 1 deletion swfiles/sw_fitpowder.m
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,9 @@ function plot_1d_cuts_of_2d_data(obj, qmins, qmaxs, params)
'This function is only valid for 2D data');
cut = struct('x', obj.ebin_cens, 'qmin', qmin, 'qmax', qmax);
ikeep = obj.modQ_cens > qmin & obj.modQ_cens <= qmax;
ifinite = isfinite(obj.y(:, ikeep));
cut.y = mean(obj.y(:, ikeep), 2, 'omitnan');
cut.e = sqrt(sum(obj.e(:, ikeep).^2, 2))/sum(ikeep);
cut.e = sqrt(sum(obj.e(:, ikeep).^2, 2))./sum(ifinite, 2);
end
function ycalc = rebin_powspec_to_1D_cuts(obj, ycalc)
% sum up successive nQ points along |Q| axis (dim=2)
Expand Down
Loading