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

Small fix in geo functions

parent dc5d9e33
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ function [samXYZ, lab2sam, rottensors] = gtGeoLab2Sam(labXYZ, omega, labgeo, sam ...@@ -4,7 +4,7 @@ function [samXYZ, lab2sam, rottensors] = gtGeoLab2Sam(labXYZ, omega, labgeo, sam
% [samXYZ, lab2sam] = gtGeoLab2Sam(labXYZ, omega, labgeo, samgeo, varargin) % [samXYZ, lab2sam] = gtGeoLab2Sam(labXYZ, omega, labgeo, samgeo, varargin)
% %
% conf = struct('only_rot', false, 'element_wise', true, ... % conf = struct('only_rot', false, 'element_wise', true, ...
% 'diffractometer', [], 'phi', 0, 'omega', 0, 'alpha', 0, 'beta', 0); % 'diffractometer', [], 'basetilt', [], 'omega', [], 'sample_tilts', []);
% %
% ---------------------------------------------------------------------- % ----------------------------------------------------------------------
% %
...@@ -39,7 +39,7 @@ function [samXYZ, lab2sam, rottensors] = gtGeoLab2Sam(labXYZ, omega, labgeo, sam ...@@ -39,7 +39,7 @@ function [samXYZ, lab2sam, rottensors] = gtGeoLab2Sam(labXYZ, omega, labgeo, sam
% %
conf = struct('only_rot', false, 'element_wise', true, ... conf = struct('only_rot', false, 'element_wise', true, ...
'diffractometer', [], 'phi', 0, 'omega', 0, 'alpha', 0, 'beta', 0); 'diffractometer', [], 'basetilt', [], 'omega', [], 'sample_tilts', []);
conf = parse_pv_pairs(conf, varargin); conf = parse_pv_pairs(conf, varargin);
[size_omega(1), size_omega(2), size_omega(3)] = size(omega); [size_omega(1), size_omega(2), size_omega(3)] = size(omega);
...@@ -57,7 +57,7 @@ use_diffractometer = ~isempty(conf.diffractometer) || use_instr_tensor_4x4; ...@@ -57,7 +57,7 @@ use_diffractometer = ~isempty(conf.diffractometer) || use_instr_tensor_4x4;
% Note that Lab is an orthonormal basis by definition, but Sample may not be !! % Note that Lab is an orthonormal basis by definition, but Sample may not be !!
% Therefore needs calculation of the inverse, and not only transpose. % Therefore needs calculation of the inverse, and not only transpose.
if (~isfield(samgeo,'lab2sam') || (isfield(samgeo,'lab2sam') && isempty(samgeo.lab2sam))) if (~isfield(samgeo,'lab2sam') || (isfield(samgeo,'lab2sam') && isempty(samgeo.lab2sam)))
if (conf.only_rot) if (conf.only_rot)
% Keep norm of input vectors -> keep unit lengths in the rows of % Keep norm of input vectors -> keep unit lengths in the rows of
% the transformation matrix % the transformation matrix
......
...@@ -4,7 +4,7 @@ function [labXYZ, sam2lab, rottensors] = gtGeoSam2Lab(samXYZ, omega, labgeo, sam ...@@ -4,7 +4,7 @@ function [labXYZ, sam2lab, rottensors] = gtGeoSam2Lab(samXYZ, omega, labgeo, sam
% [labXYZ, sam2lab] = gtGeoSam2Lab(samXYZ, om, labgeo, samgeo, freevec, varargin) % [labXYZ, sam2lab] = gtGeoSam2Lab(samXYZ, om, labgeo, samgeo, freevec, varargin)
% %
% conf = struct('only_rot', false, 'element_wise', true, ... % conf = struct('only_rot', false, 'element_wise', true, ...
% 'diffractometer', [], 'phi', 0, 'omega', 0, 'alpha', 0, 'beta', 0); % 'diffractometer', [], 'basetilt', [], 'omega', [], 'sample_tilts', []);
% %
% ----------------------------------------------------------------------- % -----------------------------------------------------------------------
% %
...@@ -56,7 +56,7 @@ use_diffractometer = ~isempty(conf.diffractometer) || use_instr_tensor_4x4; ...@@ -56,7 +56,7 @@ use_diffractometer = ~isempty(conf.diffractometer) || use_instr_tensor_4x4;
% Transformation matrix from Sample to Lab coordinates: % Transformation matrix from Sample to Lab coordinates:
% (Lab is an orthonormal basis by definition.) % (Lab is an orthonormal basis by definition.)
if (~isfield(samgeo,'sam2lab') || (isfield(samgeo,'sam2lab') && isempty(samgeo.sam2lab))) if (~isfield(samgeo,'sam2lab') || (isfield(samgeo,'sam2lab') && isempty(samgeo.sam2lab)))
if (conf.only_rot) if (conf.only_rot)
% Keep norm of input vectors -> keep unit lengths in the rows of % Keep norm of input vectors -> keep unit lengths in the rows of
% the transformation matrix % the transformation matrix
...@@ -67,7 +67,7 @@ if (~isfield(samgeo,'sam2lab') || (isfield(samgeo,'sam2lab') && isempty(samgeo.s ...@@ -67,7 +67,7 @@ if (~isfield(samgeo,'sam2lab') || (isfield(samgeo,'sam2lab') && isempty(samgeo.s
samgeo.diry * samgeo.voxsize(2); ... samgeo.diry * samgeo.voxsize(2); ...
samgeo.dirz * samgeo.voxsize(3) ]; samgeo.dirz * samgeo.voxsize(3) ];
end end
elseif (conf.only_rot) elseif (conf.only_rot)
error('Transformation matrix already defined. Set ''only_rot'' to false.') error('Transformation matrix already defined. Set ''only_rot'' to false.')
else else
......
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