Skip to content
Snippets Groups Projects
Commit c454fb0f authored by Laura Nervo's avatar Laura Nervo Committed by Nicola Vigano
Browse files

zUtil_Cryst : calculation of lattice_system


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@375 4c865b51-4357-4376-afb4-474e03ccb993
parent 53fc5f68
No related branches found
No related tags found
No related merge requests found
function [lattice,table]=gtReadSpaceGroup(sg)
% GTREADSPACEGROUP Read the spacegroup and give the hermann_mauguin symbol
% [lattice,table]=gtReadSpaceGroup(sg)
% ------------------------------------
%
% INPUT:
% sg = spacegroup to look at <double>
%
% OUTPUT:
% lattice = lattice system for this spacegroup
% table = mhashtable with spacegroup,hermann_mauguin
%
fid=fopen('spacegroups.dat','r');
C=textscan(fid,'%s %d','delimiter','\t','commentstyle','matlab');
fclose(fid);
spacegroup=uint8(C{2});
hermann=C{1};
n=size(hermann,1);
table=mhashtable;
for i=1:n
s=hermann{i};
s(isspace(s))=[];
table.put(num2str(spacegroup(i)),s);
end
table.remove('0');
herm=table.get(num2str(sg));
if between(sg,143,167)
if ~isempty(strfind(herm,'P')) % hexagonal lattice
lattice = 'hexagonal'; % a1 = a2 = a3 ~= c; alpha = beta = 90; gamma = 120
elseif ~isempty(strfind(herm,'R')) % rhombohedral lattice
lattice = 'rhombohedral'; % a = b = c; alpha = beta = gamma ~= 90
end
else
lattice ='';
end
end % end of function
\ No newline at end of file
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