-
Updating and improving the generation of the lists with symmetry operators and reflections for each space group. Changes: - gtCrystCalculateReflections : removed calculation of symmetry operators, done now in gtCrystCalculateSymmetryOperators; the function is needed to get the reflection list only, using script "reflections_list.py - gtCrystCalculateSymmetryOperators : calculates symmetry operators given a space group (using python script "symmetry_operators_list.py" Renamed create_reflections_list.py into reflections_list.py Signed-off-by:
Laura Nervo <laura.nervo@esrf.fr> git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@955 4c865b51-4357-4376-afb4-474e03ccb993
Updating and improving the generation of the lists with symmetry operators and reflections for each space group. Changes: - gtCrystCalculateReflections : removed calculation of symmetry operators, done now in gtCrystCalculateSymmetryOperators; the function is needed to get the reflection list only, using script "reflections_list.py - gtCrystCalculateSymmetryOperators : calculates symmetry operators given a space group (using python script "symmetry_operators_list.py" Renamed create_reflections_list.py into reflections_list.py Signed-off-by:
Laura Nervo <laura.nervo@esrf.fr> git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@955 4c865b51-4357-4376-afb4-474e03ccb993
gtCrystCalculateReflections.m 2.93 KiB
function [hkl, theta, hkil, sintheta] = gtCrystCalculateReflections(latticepar, mintheta, maxtheta, sg, typelist, filename)
% GTCRYSTCALCULATEREFLECTIONS Calculate the reflections list using python
% from xfab library in fable
% [hkl, theta, hkil, sintheta] = gtCrystCalculateReflections(latticepar, mintheta, maxtheta, sg, typelist, filename)
% ------------------------------------------------------------------------------------------------------------------
%
% INPUT:
% latticepar = lattice parameters <double 1x6>
% mintheta = minimum sin(theta)/lambda allowed <double> {0.0001}
% maxtheta = maximum sin(theta)/lambda allowed <double>
% sg = spacegroup number <int>
% typelist = type of list <string> [{'all'}/'unique']
% filename = filename for output <string>
%
% OUTPUT:
% hkl = reflection list <double>
% theta = theta value for each reflection <double>
% hkil = hkil indexes if needed <double>
% sintheta = sind(theta)/lambda <double>
%
%
% Version 001 03-12-2012 by LNervo
if ~exist('latticepar','var') || isempty(latticepar)
load parameters;
latticepar = parameters.cryst(1).latticepar;
end
if ~exist('mintheta','var') || isempty(mintheta)
mintheta = 0.0001;
end
if ~exist('maxtheta','var') || isempty(maxtheta)
load parameters;
tmp = parameters.labgeo.detanglemax;
maxtheta = sind(tmp)/gtConvEnergyToWavelength(parameters.acq.energy);
clear tmp
end
if ~exist('sg','var') || isempty(sg)
load parameters;
sg = parameters.cryst(1).spacegroup;
end
if ~exist('typelist','var') || isempty(typelist)
typelist = 'all';
end
if ~exist('filename','var') || isempty(filename)
filename = 'reflections_';
end
latticepar_str = sprintf('%f ', latticepar);
script_file = fullfile('/users/',getenv('USER'),'matlabDCT','zUtil_Python','reflections_list.py');
cmd = sprintf('python26 %s %s %f %f %d %s %s',...
script_file,latticepar_str,mintheta,maxtheta,sg,typelist,filename);
[~,msg]=unix(cmd);
disp(msg)
[C,Cmat] = gtReadTextFile([filename typelist '.txt'],'%f %f %f %f','\n','#',[1 3]);
hkl = Cmat(:,1:3);
sinth = Cmat(:,4);
if nargout > 1
load parameters;
energy = parameters.acq.energy;
theta = asind(sinth)*gtConvEnergyToWavelength(energy);
if nargout > 2
% for planes with Miller Indexes hkl -> hkil
hkil = hkl;
hkil(:,4) = hkl(:,3);
hkil(:,3) = -hkil(:,1)-hkil(:,2);
disp(' h k i l theta')
disp('-------------------------')
for ii=1:size(hkl,1)
fprintf('%3d %3d %3d %3d %7.3f\n',hkil(ii,:),theta(ii))
end
if nargout > 3
sintheta = sinth;
end
end
else
disp(' h k l sin(theta)/lambda')
disp('---------------------------------')
for ii=1:size(hkl,1)
fprintf('%3d %3d %3d %7.3f\n',hkl(ii,:),sinth(ii))
end
end
end % end of function