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

Diffractometer: adding sample translations on top of the sample tilts

parent 55e787c1
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,8 @@ function [t, t_sam, t_rot, t_base] = gtGeoDiffractometerTensor(diff, type, freev
conf = struct( ...
'angles_basetilt', 0, ...
'angles_rotation', 0, ...
'angles_sam_tilt', zeros(0, 1) );
'angles_sam_tilt', zeros(0, 1), ...
'shifts_sam_stage', zeros(0, 3) );
conf = parse_pv_pairs(conf, varargin);
num_rotations = numel(conf.angles_rotation);
......@@ -15,13 +16,18 @@ function [t, t_sam, t_rot, t_base] = gtGeoDiffractometerTensor(diff, type, freev
% Whether we do a SAM->LAB or a LAB->SAM tensor
is_sam2lab = strcmpi(type, 'sam2lab');
t_shift = eye(4);
if (is_sam2lab && ~isempty(conf.shifts_sam_stage))
t_shift(:, 4) = [conf.shifts_sam_stage'; 1];
end
% Building sample tilt components
if (iscell(conf.angles_sam_tilt))
error('gtGeoDiffractometerTensor:not_implemented', 'multiple_sample tilts not implemented yet')
elseif (isempty(conf.angles_sam_tilt) || isempty(diff.axes_sam_tilt))
t_sam = eye(4);
t_sam = t_shift;
else
t_sam = eye(4);
t_sam = t_shift;
if (is_sam2lab)
axes_order = size(diff.axes_sam_tilt, 1):-1:1;
else
......@@ -36,6 +42,11 @@ function [t, t_sam, t_rot, t_base] = gtGeoDiffractometerTensor(diff, type, freev
end
end
if (~is_sam2lab && ~isempty(conf.shifts_sam_stage))
t_shift(:, 4) = [-conf.shifts_sam_stage'; 1];
t_sam = t_shift * t_sam;
end
% Building rotation components
if (isempty(conf.angles_rotation))
t_rot = eye(4);
......
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