diff --git a/zUtil_Cryst/gtCrystCalculateSymmetryOperators.m b/zUtil_Cryst/gtCrystCalculateSymmetryOperators.m index 09c88867fbf482e2590572a94b5e585ad9778536..87470fb5645ff352834ad4abc13548f2cc856775 100644 --- a/zUtil_Cryst/gtCrystCalculateSymmetryOperators.m +++ b/zUtil_Cryst/gtCrystCalculateSymmetryOperators.m @@ -1,18 +1,21 @@ -function [perm, rot, sg_rot, sg_trans] = gtCrystCalculateSymmetryOperators(sg, crystal_system) +function [symm, opsym] = gtCrystCalculateSymmetryOperators(sg, crystal_system) % GTCRYSTCALCULATEREFLECTIONS Calculate the symmetry operators list using python % from xfab library in fable (sg.py) -% [perm, rot, sg_rot, sg_trans] = gtCrystCalculateSymmetryOperators(sg, crystal_system) -% ------------------------------------------------------------------------------------- +% [symm, opsym] = gtCrystCalculateSymmetryOperators(sg, crystal_system) +% --------------------------------------------------------------------- % % INPUT: % sg = spacegroup number <int> % crystal_system = crystal system <string> % % OUTPUT: -% perm = set of indistinguishable lattice permutations -% rot = set of unitary rotation matrices corresponding to the indistinguishable lattice permutations -% sg_rot = rotations (complete list using symmetry operators) -% sg_trans = transition values from symmetry operators +% symm = <struct 1xN> contains : +% .perm = set of indistinguishable lattice permutations <double 3x3> +% .rot = set of unitary rotation matrices corresponding to the +% indistinguishable lattice permutations <double 3x3> +% opsym = <struct 1xM> contains : +% .sg_rot = rotations (complete list using symmetry operators) <double 3x3> +% .sg_trans = transition values from symmetry operators <double 1x3> % % % Version 001 10-12-2012 by LNervo @@ -33,19 +36,14 @@ cmd = sprintf('python26 %s %d',script_file,sg); disp(msg) % read produced files -perm = gtReadTextFile(['perm_' crystal_system '.txt'],'%f %f %f',' ','#',[3 3]); +perm = gtReadTextFile(['perm_' crystal_system '.txt'],'%f %f %f',' ','#',[3 3]); rotN = gtReadTextFile(['rot_' crystal_system '.txt'],'%f %f %f',' ','#',[3 3]); sg_rotN = gtReadTextFile(['sg_rot_' crystal_system '.txt'],'%f %f %f',' ','#',[3 3]); sg_transN = gtReadTextFile(['sg_trans_' crystal_system '.txt'],'%f %f %f',' ','#',[1 3]); -if nargout > 1 - rot = rotN; - if nargout > 2 - sg_rot = sg_rotN; - if nargout > 3 - sg_trans = sg_transN; - end - end +symm = struct('g3', rotN, 'g', [], 'perm', perm); +if nargout == 2 + opsym = struct('sg_rot', sg_rotN, 'sg_trans', sg_transN); end end % end of function diff --git a/zUtil_Python/symmetry_operators_list.py b/zUtil_Python/symmetry_operators_list.py index 8b5db8fe0db62e29fb605119440272c19f71cd83..5b20b2e414373f4bcac07b95441bf9e9aff324ce 100644 --- a/zUtil_Python/symmetry_operators_list.py +++ b/zUtil_Python/symmetry_operators_list.py @@ -23,8 +23,7 @@ _sgno = int(sys.argv[1]) print("") print(" *** Input data ***") -print(" spacegroup: %s" % _sgno) -print("") +print(" spacegroup: %s" % _sgno) if _sgno != None: spg = sg.sg(sgno=_sgno) @@ -34,6 +33,8 @@ if _sgno != None: # crystal system crystal_system = spg.crystal_system + print(" crystal system: %s" % crystal_system) + print("") print("Found %d symmetry operators for crystal system %s\n" % (nsymop, crystal_system)) # rotations list