Skip to content
Snippets Groups Projects
Commit 377fbca9 authored by Wolfgang Ludwig's avatar Wolfgang Ludwig
Browse files

Add offsets to Diffractometer geometry function

parent a01d4871
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@ function diff = gtGeoDiffractometerDefinition(types)
'axes_sam_tilt', {zeros(0, 3)}, ... % They are applied in reverse order (last->first) for SAM->LAB transformations in gtGeoDiffractometerTensor
'origin_basetilt', {zeros(1, 3)}, ...
'origin_rotation', {zeros(1, 3)}, ...
'origin_sam_tilt', {zeros(0, 3)} );
'origin_sam_tilt', {zeros(0, 3)}, ...
'shifts_sam_stage', {zeros(0, 3)} );
if (iscell(types))
diff(2:numel(types)) = diff;
......@@ -16,9 +17,10 @@ function diff = gtGeoDiffractometerDefinition(types)
switch (lower(types))
case 'esrf_id11'
diff.axes_basetilt = [0, 1, 0];
diff.axes_rotation = [0, 0, -1];
diff.axes_rotation = [0, 0, 1];
diff.axes_sam_tilt = [0, 1, 0; 1, 0, 0];
diff.origin_sam_tilt = [0, 0, 0; 0, 0, 0];
diff.limits_sam_tilt = [-15, 15; -20 20];
otherwise
error('gtAcqDiffractometerDefinition:wrong_argument', ...
'Unknown diffractometer: %s', types)
......
......@@ -2,8 +2,7 @@ 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), ...
'shifts_sam_stage', zeros(0, 3) );
'angles_sam_tilt', zeros(0, 1) );
conf = parse_pv_pairs(conf, varargin);
num_rotations = numel(conf.angles_rotation);
......@@ -17,8 +16,8 @@ function [t, t_sam, t_rot, t_base] = gtGeoDiffractometerTensor(diff, type, freev
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];
if (is_sam2lab && ~isempty(diff.shifts_sam_stage))
t_shift(:, 4) = [diff.shifts_sam_stage'; 1];
end
% Building sample tilt components
......@@ -42,8 +41,8 @@ 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];
if (~is_sam2lab && ~isempty(diff.shifts_sam_stage))
t_shift(:, 4) = [-diff.shifts_sam_stage'; 1];
t_sam = t_shift * t_sam;
end
......
......@@ -5,7 +5,7 @@ function t = gtMathsRotationTranslationTensor(t_axis, t_angles, t_orig, freevec)
rot_comp = gtMathsRotationMatrixComp(t_axis', 'col');
t = eye(4);
t = repmat(t, 1, 1, numel(t_angles));
t = repmat(t, [1, 1, numel(t_angles)]);
t(1:3, 1:3, :) = gtMathsRotationTensor(t_angles, rot_comp);
t_tr_pre = 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