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

gtCrystSignedHKLs : added output hklsp and thtype


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent d32aa4a4
No related branches found
No related tags found
No related merge requests found
function [allshkls, allhklinds, mult] = gtCrystSignedHKLs(hkl, symm) function [allshkls, allhklinds, mult, hklsp, thtype] = gtCrystSignedHKLs(hkl, symm)
% GTCRYSTSIGNEDHKLS Gives a complete list of signed hkl planes, by % GTCRYSTSIGNEDHKLS Gives a complete list of signed hkl planes, by
% applying symmetry operators of the specified spacegroup to the input % applying symmetry operators of the specified spacegroup to the input
% list of plane families. % list of plane families.
...@@ -6,21 +6,29 @@ function [allshkls, allhklinds, mult] = gtCrystSignedHKLs(hkl, symm) ...@@ -6,21 +6,29 @@ function [allshkls, allhklinds, mult] = gtCrystSignedHKLs(hkl, symm)
% 'lattice_system' and 'crystal_system' instead of spacegroups should % 'lattice_system' and 'crystal_system' instead of spacegroups should
% be considered. % be considered.
% %
% [allshkls, allhklinds, mult] = gtCrystSignedHKLs(hkl,symm) % [allshkls, allhklinds, mult, hklsp, thtype] = gtCrystSignedHKLs(hkl, symm)
% ---------------------------------------------------------- % --------------------------------------------------------------------------
% %
% INPUT: % INPUT:
% hkl = <double> plane families (one in a column) % hkl = <double> plane families (one in a column) as in
% parameters.cryst
% (3,n) for cubic lattices % (3,n) for cubic lattices
% (4,n) for hexagonal lattices % (4,n) for hexagonal lattices
% symm = <struct> structure containing .g3/.g with symmetry % symm = <struct> structure containing .g3/.g with symmetry
% operators % operators
% %
% OUTPUT: % OUTPUT:
% allshkls = complete list of signed hkl planes % allshkls = <double> complete list of signed hkl planes
% (including Friedel pairs) % (including Friedel pairs)
% allhklinds = indices in allshkls according to input hkl % allhklinds = <double> indices in allshkls according to input hkl
% mult = <int8> multiplicity of hkl families (1,k) % mult = <double> multiplicity of hkl families (1,k)
% hklsp = <double> list of all the hkls (friedel not considered)
% thtype = <double> theta types among the given reflections
% according to input hkl
%
%
% Version 003 21-08-2013 by LNervo
% Added output hklsp and thtype to simplify calculation
% %
% Version 002 10-07-2013 by LNervo % Version 002 10-07-2013 by LNervo
% Added check of class for hkl list % Added check of class for hkl list
...@@ -54,6 +62,9 @@ ncols = size(hkl,2); ...@@ -54,6 +62,9 @@ ncols = size(hkl,2);
allshkls = []; allshkls = [];
allhklinds = []; allhklinds = [];
mult = [];
hklsp = [];
thtype = [];
% Loop through input hkl types % Loop through input hkl types
for ii = 1:size(hkl,1) for ii = 1:size(hkl,1)
...@@ -70,12 +81,14 @@ for ii = 1:size(hkl,1) ...@@ -70,12 +81,14 @@ for ii = 1:size(hkl,1)
newshkls = unique(shkls, 'rows'); newshkls = unique(shkls, 'rows');
% sort according to h > k > l % sort according to h > k > l
newshkls = sortrows(newshkls, [-1 -2 -ncols]); newshkls = sortrows(newshkls, [-1 -2 -ncols]);
nhkls = size(newshkls,1)/2;
allshkls = [allshkls; newshkls]; mult = [mult; nhkls*2];
allshkls = [allshkls; newshkls];
mult(ii,1) = size(newshkls,1); allhklinds = [allhklinds; repmat(ii,nhkls*2,1)];
%newshkls = sortrows(newshkls, [ncols 1 2]);
allhklinds = [allhklinds; repmat(ii,size(newshkls,1),1)]; hklsp = [hklsp; newshkls(nhkls+1:end,:)];
thtype = [thtype; repmat(ii,nhkls,1)];
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