Skip to content
Snippets Groups Projects
Commit ec796c0d authored by Yoann Guilhem's avatar Yoann Guilhem Committed by Nicola Vigano
Browse files

Slight modifications to crystal cmap functions

parent 6814c728
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ function [hf, ha, hp] = gtCrystAxisCmap_key(N, XYZlabels, cardinal) ...@@ -32,7 +32,7 @@ function [hf, ha, hp] = gtCrystAxisCmap_key(N, XYZlabels, cardinal)
% - x: // y tomo; % - x: // y tomo;
% - y: // x tomo; % - y: // x tomo;
% - z: // negative z tomo % - z: // negative z tomo
%
% Version 002 16-01-2013 by YGuilhem % Version 002 16-01-2013 by YGuilhem
% Factorized and vectorized function, add some optional arguments % Factorized and vectorized function, add some optional arguments
% %
...@@ -42,8 +42,9 @@ Nmin = 10; ...@@ -42,8 +42,9 @@ Nmin = 10;
if ~exist('N', 'var') || isempty(N) if ~exist('N', 'var') || isempty(N)
N = 90; N = 90;
elseif N < Nmin elseif N < Nmin
warning(['You should use at least ' num2str(Nmin) ... warning('gtCrystAxisCmap_key:wrong_argument', ...
' increments, setting it so!']); ['You should use at least ' num2str(Nmin) ...
' increments, setting it so !']);
N = Nmin; N = Nmin;
end end
......
...@@ -17,6 +17,7 @@ function [cmap, Vsst, Vc_symm] = gtIPFCmap(phaseid, LD, varargin) ...@@ -17,6 +17,7 @@ function [cmap, Vsst, Vc_symm] = gtIPFCmap(phaseid, LD, varargin)
% {true} % {true}
% 'crystal_system' = <string> Legacy to set (force) the crystal system % 'crystal_system' = <string> Legacy to set (force) the crystal system
% for old datasets % for old datasets
% 'r_vectors' = <double> Rodrigues vectors as N x 3 array
% %
% OUTPUT: % OUTPUT:
% cmap = <double> RGB color map, color code is the inverse % cmap = <double> RGB color map, color code is the inverse
...@@ -25,6 +26,8 @@ function [cmap, Vsst, Vc_symm] = gtIPFCmap(phaseid, LD, varargin) ...@@ -25,6 +26,8 @@ function [cmap, Vsst, Vc_symm] = gtIPFCmap(phaseid, LD, varargin)
% moved to the SST triangle % moved to the SST triangle
% Vc_symm = <double> Row vectors expressed in crystal frame % Vc_symm = <double> Row vectors expressed in crystal frame
% %
% Version 002 08-02-2013 by YGuilhem
% Add r_vectors as optional input
% %
% Version 003 08-01-2013 by LNervo % Version 003 08-01-2013 by LNervo
% Added second output argument: Vsst % Added second output argument: Vsst
...@@ -39,6 +42,7 @@ function [cmap, Vsst, Vc_symm] = gtIPFCmap(phaseid, LD, varargin) ...@@ -39,6 +42,7 @@ function [cmap, Vsst, Vc_symm] = gtIPFCmap(phaseid, LD, varargin)
par.saturate = true; par.saturate = true;
par.save = false; par.save = false;
par.crystal_system = ''; par.crystal_system = '';
par.r_vectors = [];
par = parse_pv_pairs(par, varargin); par = parse_pv_pairs(par, varargin);
% Set default phaseid % Set default phaseid
...@@ -53,19 +57,24 @@ end ...@@ -53,19 +57,24 @@ end
% Get the r-vectors % Get the r-vectors
r_vectors = []; r_vectors = [];
if exist(fullfile('4_grains', sprintf('phase_%02d', phaseid), 'r_vectors.mat'), 'file') phaseDir = fullfile('4_grains', sprintf('phase_%02d', phaseid));
load(fullfile('4_grains', sprintf('phase_%02d', phaseid), 'r_vectors.mat')); if ~isempty(par.r_vectors)
if size(r_vectors,2) == 4 r_vectors = par.r_vectors;
r_vectors = r_vectors(:, 2:4); elseif exist(fullfile(phaseDir, 'r_vectors.mat'), 'file')
end load(fullfile(phaseDir, 'r_vectors.mat'));
elseif exist(fullfile('4_grains', sprintf('phase_%02d', phaseid), 'index.mat'), 'file') elseif exist(fullfile(phaseDir, 'index.mat'), 'file')
grain = []; grain = [];
load(fullfile('4_grains', sprintf('phase_%02d', phaseid), 'index.mat'), 'grain'); load(fullfile(phaseDir, 'index.mat'), 'grain');
r_vectors = gtIndexAllGrainValues(grain, 'R_vector', [], 1:3, []); r_vectors = gtIndexAllGrainValues(grain, 'R_vector', [], 1:3, []);
else else
gtError('gtIPFCmap:missing_file', 'Could not find r_vectors.mat or index.mat file!'); gtError('gtIPFCmap:missing_file', 'Could not find r_vectors.mat or index.mat file!');
end end
% Resize r_vectors if needed
if size(r_vectors,2) == 4
r_vectors = r_vectors(:, 2:4);
end
% Get the symmetry operators % Get the symmetry operators
if isempty(par.crystal_system) if isempty(par.crystal_system)
parameters = load('parameters.mat'); parameters = load('parameters.mat');
......
...@@ -39,7 +39,6 @@ inc = phimax/N; ...@@ -39,7 +39,6 @@ inc = phimax/N;
psimin = 0; psimin = 0;
psimax = atan(sqrt(2))+inc; psimax = atan(sqrt(2))+inc;
chimin = 0;
chimax = pi/4; chimax = pi/4;
for phi=phimin:inc:(phimax-inc) % Rotation around z-axis for phi=phimin:inc:(phimax-inc) % Rotation around z-axis
......
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