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

Shape-functions: fixed another bug due to the 360->0 boundary (mainly seen in...

Shape-functions: fixed another bug due to the 360->0 boundary (mainly seen in W but also present in N)

Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>
parent 81779d03
No related branches found
No related tags found
No related merge requests found
......@@ -48,9 +48,19 @@ function bl = gtDefFwdProjGvdm2NW(grain, ref_sel, gv, fedpars, parameters, eta_s
sinths = grain.allblobs.sintheta(ref_sel);
ominds = grain.allblobs.omind(ref_sel);
ref_ws = grain.allblobs.detector(det_ind).uvw(ref_sel, 3);
w_shifts = round(ref_ws ./ blobs_w_interp);
ref_ns = grain.allblobs.eta(ref_sel);
if (isfield(fedpars, 'ref_omega') && ~isempty(fedpars.ref_omega))
ref_oms = fedpars.ref_omega(ref_sel);
else
ref_oms = grain.allblobs.omega(ref_sel);
end
w_shifts = round(ref_oms ./ om_step ./ blobs_w_interp);
if (isfield(fedpars, 'ref_eta') && ~isempty(fedpars.ref_eta))
ref_ns = fedpars.ref_eta(ref_sel);
else
ref_ns = grain.allblobs.eta(ref_sel);
end
n_shifts = round(ref_ns ./ eta_step);
% The plane normals need to be brought in the Lab reference where the
......@@ -108,8 +118,9 @@ function bl = gtDefFwdProjGvdm2NW(grain, ref_sel, gv, fedpars, parameters, eta_s
numel(inds_bad), numel(om), ii_b)
end
om = gtGrainAnglesTabularFix360deg(om, ref_oms(ii_b));
w_bl = om ./ om_step;
w_bl = gtGrainAnglesTabularFix360deg(w_bl, ref_ws(ii_b), parameters);
w_bl = w_bl / blobs_w_interp(ii_b);
w_bl = w_bl - w_shifts(ii_b);
......
......@@ -48,8 +48,13 @@ function bl = gtDefFwdProjGvdm2W(grain, ref_sel, gv, fedpars, parameters, det_in
sinths = grain.allblobs.sintheta(ref_sel);
ominds = grain.allblobs.omind(ref_sel);
ref_ws = grain.allblobs.detector(det_ind).uvw(ref_sel, 3);
w_shifts = round(ref_ws ./ blobs_w_interp);
if (isfield(fedpars, 'ref_omega'))
ref_oms = fedpars.ref_omega(ref_sel);
else
ref_oms = grain.allblobs.omega(ref_sel);
end
w_shifts = round(ref_oms ./ om_step ./ blobs_w_interp);
% The plane normals need to be brought in the Lab reference where the
% beam direction and rotation axis are defined.
......@@ -106,8 +111,9 @@ function bl = gtDefFwdProjGvdm2W(grain, ref_sel, gv, fedpars, parameters, det_in
numel(inds_bad), numel(om), ii_b)
end
om = gtGrainAnglesTabularFix360deg(om, ref_oms(ii_b));
w_bl = om ./ om_step;
w_bl = gtGrainAnglesTabularFix360deg(w_bl, ref_ws(ii_b), parameters);
w_bl = w_bl / blobs_w_interp(ii_b);
w_bl = w_bl - w_shifts(ii_b);
......
......@@ -37,7 +37,9 @@ function shape_funcs = gtDefShapeFunctionsFwdProj(sampler, varargin)
'dcomps', [1 1 1 0 0 0 0 0 0] == 1, ...
'defmethod', 'rod_rightstretch', ...
'detector', repmat( fed_pars_detector, [num_detectors, 1]), ...
'projector', conf.projector );
'projector', conf.projector, ...
'ref_omega', [], ...
'ref_eta', [] );
voxel_size = sampler.stats.sampling.gaps;
......@@ -104,6 +106,10 @@ function shape_funcs = gtDefShapeFunctionsFwdProj(sampler, varargin)
% compute the scattering info for the selected reflections
sel_bls = 1:numel(find(sampler.selected));
ref_inds = sampler.ondet(sampler.included(sampler.selected));
fedpars.ref_omega = ref_gr.allblobs.omega(ref_inds);
fedpars.ref_eta = ref_gr.allblobs.eta(ref_inds);
% Only one lattice allowed for the moment!
num_ors = numel(sampler.lattice(1).gr);
shape_funcs = cell(num_ors, 1);
......
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