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) ...@@ -2,25 +2,28 @@ function list = gtCrystFindFamilies(hklsp, cryst)
% GTCRYSTFINDFAMILIES % GTCRYSTFINDFAMILIES
% list = gtCrystFindFamilies(hklsp, cryst) % 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 % and then sorting in descending order
% %
% INPUT: % INPUT:
% hklsp = <double> hk(i)l of reflections (n,3) or (n,4) % hklsp = <double> hk(i)l of reflections (n,3) or (n,4)
% Bmat = <double> B matrix (3,3) % cryst = <struct> parameters.cryst
% %
% OUTPUT: % OUTPUT:
% list = <struct> information about d-spacing, theta % list = <struct> information about d-spacing, theta
% .hkl % .hkl
% .hklsp % .hklsp
% .thetatype
% .thetatypesp % .thetatypesp
% .dspacing
% .dspacingsp % .dspacingsp
% .mult % .mult
% .indfam % .allshkls
% .table % .allhklinds
% .tablesp % .allthetatype
% .alldspacing
% .ind
% .hklind
% .dspacingfam
% .hklfam
% each row one reflection % each row one reflection
if size(hklsp,2) > size(hklsp,1) if size(hklsp,2) > size(hklsp,1)
...@@ -37,35 +40,23 @@ symm = gtCrystGetSymmetryOperators(cryst.crystal_system, cryst.spacegroup); ...@@ -37,35 +40,23 @@ symm = gtCrystGetSymmetryOperators(cryst.crystal_system, cryst.spacegroup);
hkl = allshkls(ind,:); hkl = allshkls(ind,:);
% calculate d-spacing % 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]; list.hkl = double(hkl');
table = [hklsp hklind ind mult hkl]; list.hklsp = double(hklsp');
list.thetatypesp = allthetatype(ind)';
thetatype = thetatypesp(ind); list.dspacingsp = double(alldspacing(ind)');
dspacing = dspacingsp(ind);
list.hkl = hkl';
list.hklsp = hklsp';
list.thetatype = thetatype';
list.dspacing = dspacing';
list.mult = mult'; list.mult = mult';
list.allshkls = allshkls'; list.allshkls = allshkls';
list.allhklinds = allhklinds'; list.allhklinds = allhklinds';
list.allthetatype = thetatypesp'; list.allthetatype = allthetatype';
list.alldspacing = dspacingsp'; list.alldspacing = alldspacing';
list.ind = ind';
list.hklind = hklind';
for ii=1:length(list.thetatype) list.dspacingfam = double(dspacingfam');
if size(hkl,2)==3 list.hklfam = unique(hkl, 'rows');
fprintf( '%3d %3d %3d %5d %5d\n',list.hkl(:,ii),list.thetatype(ii),list.mult(ii) );
elseif size(hkl,2)==4 end % end of function
fprintf( '%3d %3d %3d %3d %5d %5d\n',list.hkl(:,ii),list.thetatype(ii),list.mult(ii) );
end
end
end
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