Skip to content
Snippets Groups Projects
Commit b9ea04d3 authored by Laura Nervo's avatar Laura Nervo
Browse files

gtCrystFindFamilies : Reads hklsp list from a grain and find the corresponding...

gtCrystFindFamilies : Reads hklsp list from a grain and find the corresponding hkl family. Saves hkl, thetatypesp, dspacingsp, mult info for each reflection assigned to the grain (sorting according to dspacing values - needs single values in this case).
                      Gives in the output extra info as thetatype, dpsacing, hkls, hklind for the complete list with the symmetrics.

Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent a444d95d
No related branches found
No related tags found
No related merge requests found
......@@ -2,25 +2,28 @@ function list = gtCrystFindFamilies(hklsp, cryst)
% GTCRYSTFINDFAMILIES
% list = gtCrystFindFamilies(hklsp, cryst)
% ----------------------------------------
% From the hkl list, finds the unique families by calculating the d-spacing
% From the hklsp list, finds the unique families by calculating the d-spacing
% and then sorting in descending order
%
% INPUT:
% hklsp = <double> hk(i)l of reflections (n,3) or (n,4)
% Bmat = <double> B matrix (3,3)
% cryst = <struct> parameters.cryst
%
% OUTPUT:
% list = <struct> information about d-spacing, theta
% .hkl
% .hklsp
% .thetatype
% .thetatypesp
% .dspacing
% .dspacingsp
% .mult
% .indfam
% .table
% .tablesp
% .allshkls
% .allhklinds
% .allthetatype
% .alldspacing
% .ind
% .hklind
% .dspacingfam
% .hklfam
% each row one reflection
if size(hklsp,2) > size(hklsp,1)
......@@ -37,35 +40,23 @@ symm = gtCrystGetSymmetryOperators(cryst.crystal_system, cryst.spacegroup);
hkl = allshkls(ind,:);
% calculate d-spacing
dspacingsp = gtCrystDSpacing(allshkls', Bmat)';
alldspacing = gtCrystDSpacing(allshkls', Bmat)';
alldspacing = single(alldspacing); % needed to do unique
[dspacingfam, indfam, thetatypesp] = unique(dspacingsp, 'stable');
[dspacingfam, ~, allthetatype] = unique(alldspacing, 'stable');
tablesp = [allshkls allhklinds dspacingsp thetatypesp];
table = [hklsp hklind ind mult hkl];
thetatype = thetatypesp(ind);
dspacing = dspacingsp(ind);
list.hkl = hkl';
list.hklsp = hklsp';
list.thetatype = thetatype';
list.dspacing = dspacing';
list.hkl = double(hkl');
list.hklsp = double(hklsp');
list.thetatypesp = allthetatype(ind)';
list.dspacingsp = double(alldspacing(ind)');
list.mult = mult';
list.allshkls = allshkls';
list.allhklinds = allhklinds';
list.allthetatype = thetatypesp';
list.alldspacing = dspacingsp';
for ii=1:length(list.thetatype)
if size(hkl,2)==3
fprintf( '%3d %3d %3d %5d %5d\n',list.hkl(:,ii),list.thetatype(ii),list.mult(ii) );
elseif size(hkl,2)==4
fprintf( '%3d %3d %3d %3d %5d %5d\n',list.hkl(:,ii),list.thetatype(ii),list.mult(ii) );
end
end
end
list.allthetatype = allthetatype';
list.alldspacing = alldspacing';
list.ind = ind';
list.hklind = hklind';
list.dspacingfam = double(dspacingfam');
list.hklfam = unique(hkl, 'rows');
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