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

gtCrystDSpacing : set dspacing type to single (needed for gtFindFamilies and correlated stuff)

gtCrystSignedHKLs : check type of hkl (it must be double)


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent 3d028bc8
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ function dsp = gtCrystDSpacing(hkl, Bmat)
% INPUT hkl - set of Miller indices (3,n) or (4,n)
% Bmat - 'B matrix' - (hkl) to Cartesian matrix (3,3)
%
% OUTPUT dsp - row vector of d-spacings
% OUTPUT dsp - row vector of d-spacings <single>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -23,6 +23,7 @@ ghkl = Bmat*hkl;
% D-spacings
dsp = 1./sqrt(sum(ghkl.*ghkl,1));
dsp = single(dsp);
end % of function
......
......@@ -21,6 +21,13 @@ function [allshkls, allhklinds, mult] = gtCrystSignedHKLs(hkl,spacegroup)
% allhklinds = indices in allshkls according to input hkl
% mult = multiplicity of hkl families
%
% Version 002 10-07-2013 by LNervo
% Added check of class for hkl list
if ~isa(hkl,'double')
hkl = double(hkl);
end
% Get symmetry operators
symm = gtCrystGetSymmetryOperators([], spacegroup);
......@@ -40,13 +47,13 @@ for ii = 1:size(hkl,1)
% Apply all symmmetry operators to the hkl type to get signed hkl-s
for jj = 1:length(symm)
shkls(2*jj-1,:) = hkl(ii,:)*symm{jj};
shkls(2*jj,:) = -shkls(2*jj-1,:); % Friedel pair of previous one
shkls(2*jj-1,:) = hkl(ii,:)*symm{jj};
shkls(2*jj,:) = -shkls(2*jj-1,:); % Friedel pair of previous one
end
% Remove duplicates and add to the complete list
newshkls = unique(shkls, 'rows');
allshkls = [allshkls; newshkls];
allshkls = [allshkls; newshkls];
mult(ii,1) = size(newshkls,1);
......
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