Skip to content
Snippets Groups Projects
Commit d9e87d02 authored by Andrew King's avatar Andrew King Committed by Nicola Vigano
Browse files

inverse pole figure colourmaps for cubics, updates to cryst setup

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@795 4c865b51-4357-4376-afb4-474e03ccb993
parent b578210b
No related branches found
No related tags found
No related merge requests found
...@@ -271,10 +271,11 @@ function parameters = sfExpandData(parameters, ii) ...@@ -271,10 +271,11 @@ function parameters = sfExpandData(parameters, ii)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Get crystal system and lattice from the spacegroup number % Get crystal system and lattice from the spacegroup number
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[lattice_system, crystal_system] = gtReadSpaceGroup(parameters.cryst(ii).spacegroup); [lattice_system, crystal_system, herm_symbol] = gtReadSpaceGroup(parameters.cryst(ii).spacegroup);
parameters.cryst(ii).lattice_system = lattice_system; parameters.cryst(ii).lattice_system = lattice_system;
parameters.cryst(ii).crystal_system = crystal_system; parameters.cryst(ii).crystal_system = crystal_system;
clear lattice_system crystal_system parameters.cryst(ii).hermann_mauguin = herm_symbol;
clear lattice_system crystal_system herm_symbol
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% getting reflection on the detector, basing on theta max and min % getting reflection on the detector, basing on theta max and min
......
function cmap = gtIVPcubCmap(grain)
% as for hexagonal materials
% aim for RED = 001 / GREEN = 101 / BLUE = 111
% get the r-vectors
r_vectors=gtIndexAllGrainValues(grain, 'R_vector', [], 1:3, []);
sym=gtGetCubicSymOp;
% base the IVP on the lab z axis
Zlab=[0 0 1];
map = zeros(length(r_vectors+1),3);
for i=1:length(r_vectors)
g=Rod2g(r_vectors(i, :));
% z axis in cryst axes
Zc = g*Zlab';
% all equivilents by sym
Zc_sym=[];
for jj=1:length(sym)
Zc_sym(jj, :)=(sym(jj).g*Zc)';
end
Zc_sym=[Zc_sym; -Zc_sym];
% define angles phi - rotation around 001 axis, projected on the xy plane
% chi - rotation around 010, projected on xz plane
Zc_chi=rad2deg(atan2(Zc_sym(:,1), Zc_sym(:,3)));
Zc_phi=rad2deg(atan2(Zc_sym(:,2), Zc_sym(:,1)));
% pick equiv that is in our triangle
ndx=find(Zc_chi>=0 & Zc_chi<45 & Zc_phi>=0 & Zc_phi<45);
% Z sym equivilent in the part of the crystal we are interested in
Zp(i, :)=Zc_sym(ndx, :);
% colourmap
chi=Zc_chi(ndx);
phi=Zc_phi(ndx);
% these shouldn't come out negative!
red=(45-chi)/45;
green=phi/45;
blue=(45-phi)/45;
map(i+1, :)=[red green blue];
end
cmap = map;
\ No newline at end of file
function [lattice, crystal] = gtReadSpaceGroup(sg) function [lattice, crystal, herm] = gtReadSpaceGroup(sg)
% GTREADSPACEGROUP Read the spacegroup and give the hermann_mauguin symbol % GTREADSPACEGROUP Read the spacegroup and give the hermann_mauguin symbol
% [lattice, crystal] = gtReadSpaceGroup(sg) % [lattice, crystal, table] = gtReadSpaceGroup(sg)
% ------------------------------------------------ % ------------------------------------------------
% %
% INPUT: % INPUT:
...@@ -10,9 +10,10 @@ function [lattice, crystal] = gtReadSpaceGroup(sg) ...@@ -10,9 +10,10 @@ function [lattice, crystal] = gtReadSpaceGroup(sg)
% lattice = lattice system for this spacegroup % lattice = lattice system for this spacegroup
% crystal = crystal system for this spacegroup % crystal = crystal system for this spacegroup
% %
% Version 005 21-09-2012 by LNervo % Version 005 24/09/2012 by AKing
% Removed mhashtable % Remove the unused hashtable, fix the logic for trigonal
% % spacegroups, return harmann-mauguin symbol
%
% Version 004 20-09-2012 by YGuilhem % Version 004 20-09-2012 by YGuilhem
% Now using GT_MATLAB_HOME to determine path to spacegroups.dat % Now using GT_MATLAB_HOME to determine path to spacegroups.dat
% %
...@@ -21,18 +22,16 @@ function [lattice, crystal] = gtReadSpaceGroup(sg) ...@@ -21,18 +22,16 @@ function [lattice, crystal] = gtReadSpaceGroup(sg)
global GT_MATLAB_HOME global GT_MATLAB_HOME
fid = fopen( fullfile(GT_MATLAB_HOME, 'zUtil_Cryst', 'spacegroups.dat' ),'r'); fid=fopen( fullfile(GT_MATLAB_HOME, 'zUtil_Cryst', 'spacegroups.dat' ),'r');
C = textscan(fid,'%s %*d','delimiter','\t','commentstyle','matlab'); C=textscan(fid,'%s %d','delimiter','\t','commentstyle','matlab');
fclose(fid); fclose(fid);
% remove commented types from lists spacegroup=uint8(C{2});
index = cellfun(@(num) ~isempty(strfind(num, '%')), C{:}); hermann=C{1};
C{:}(index) = []; % read the hermann mauguin
herm=hermann{find(spacegroup==sg)};
% get the hermann-mauguin symbol
hermann = cellfun(@(num) strtrim(num), C{:},'UniformOutput', false);
% Spacegroups
if between(sg,1,2) if between(sg,1,2)
crystal = 'triclinic'; % a ~= b ~= c; alpha ~= beta ~= gamma ~= 90 crystal = 'triclinic'; % a ~= b ~= c; alpha ~= beta ~= gamma ~= 90
lattice = 'triclinic'; lattice = 'triclinic';
...@@ -55,11 +54,11 @@ end ...@@ -55,11 +54,11 @@ end
if between(sg,143,167) if between(sg,143,167)
crystal = 'trigonal'; crystal = 'trigonal';
if ~isempty(strfind(hermann{sg},'P')) % hexagonal lattice if ~isempty(strfind(herm,'P')) % hexagonal lattice
% a1 = a2 = a3 ~= c; alpha = beta = 90; gamma = 120 % a1 = a2 = a3 ~= c; alpha = beta = 90; gamma = 120
lattice = 'hexagonal'; lattice = 'hexagonal';
elseif ~isempty(strfind(hermann{sg},'R')) % rhombohedral lattice elseif ~isempty(strfind(herm,'R')) % rhombohedral lattice
% a = b = c; alpha = beta = gamma ~= 90 % a = b = c; alpha = beta = gamma ~= 90
lattice = 'rhombohedral'; lattice = 'rhombohedral';
end end
...@@ -75,4 +74,6 @@ if between(sg,195,230) ...@@ -75,4 +74,6 @@ if between(sg,195,230)
lattice = 'cubic'; lattice = 'cubic';
end end
end % end of function end % end of function
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