Skip to content
Snippets Groups Projects
Commit e8642c6e authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Fixed function for checking direct beam intensity

parent 5ecda002
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,14 @@ function [gr, refs] = gtComputeIncomingBeamIntensity(gr, parameters, refs)
end
omega_step = 180 / parameters.acq.nproj;
gc_det_pos = gtGeoGrainCenterSam2Det(gr.center, gr.allblobs.omega, parameters);
if (isfield(gr.proj, 'ondet'))
gr_included = gr.proj.ondet(gr.proj.included);
else
gr_included = gr.ondet(gr.included);
end
omegas = gr.allblobs.omega(gr_included);
gc_det_pos = gtGeoGrainCenterSam2Det(gr.center, omegas, parameters);
rounded_gc_det = round(gc_det_pos);
img_nums = omegas / omega_step;
......@@ -24,14 +31,14 @@ function [gr, refs] = gtComputeIncomingBeamIntensity(gr, parameters, refs)
max_selection = max_cs > 1e-4;
min_indx = sub2ind(size(refs), rounded_gc_det(:, 2), rounded_gc_det(:, 1), min_ws);
max_indx = sub2ind(size(refs), rounded_gc_det(:, 2), rounded_gc_det(:, 1), max_ws(max_selection));
max_indx = sub2ind(size(refs), rounded_gc_det(max_selection, 2), rounded_gc_det(max_selection, 1), max_ws(max_selection));
min_vals = refs(min_indx) .* min_cs;
max_vals = refs(max_indx) .* max_cs(max_selection);
int_profile = min_vals;
int_profile(max_selection) = int_profile(max_selection) + max_vals;
gr.allblobs.beam_intensity = int_profile;
gr.beam_intensity = int_profile;
% ref0 = refs;
% ref0(min_indx) = -20000;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment