Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
26510d08
Commit
26510d08
authored
6 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
Small fix in geo functions
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
dc5d9e33
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zUtil_Geo/gtGeoLab2Sam.m
+3
-3
3 additions, 3 deletions
zUtil_Geo/gtGeoLab2Sam.m
zUtil_Geo/gtGeoSam2Lab.m
+3
-3
3 additions, 3 deletions
zUtil_Geo/gtGeoSam2Lab.m
with
6 additions
and
6 deletions
zUtil_Geo/gtGeoLab2Sam.m
+
3
−
3
View file @
26510d08
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
zUtil_Geo/gtGeoSam2Lab.m
+
3
−
3
View file @
26510d08
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment