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

gtTwinTest : changed and improved functionalities


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

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@760 4c865b51-4357-4376-afb4-474e03ccb993
parent aa77f069
No related branches found
No related tags found
No related merge requests found
function out = gtTwinTest(cryst, grain1, grain2, r_vectors)
% gtTwinTest(cryst, grain1, grain2, r_vectors)
function out = gtTwinTest(phaseid, parameters, grain1, grain2, grain)
% out = gtTwinTest(phaseid, parameters, grain1, grain2, grain)
spacegroup = cryst.spacegroup;
pxsize = (parameters.labgeo.pixelsizeu + parameters.labgeo.pixelsizev)/2;
spacegroup = parameters.cryst(phaseid).spacegroup;
% find the max grainID
maxgrain=max(0, grain1);
maxgrain=max(maxgrain, grain2);
r_vectors = [];
for ii=1:length(grain)
r_vectors(ii, 1) = ii;
r_vectors(ii, 2:4) = grain{ii}.R_vector;
end
% get sym operators
if spacegroup==225 || spacegroup==229
% cubic material
......@@ -111,7 +119,6 @@ out.grain2_R_vector = r_vectors(grain2,2:4);
out.mis_angle = misorientation_angle;
out.mis_axis = misorientation_axis';
hkl=misorientation_axis';
hkil=[];
......@@ -120,11 +127,27 @@ hkil(2) = (2/sqrt(3))*hkl(2);
hkil(3) = -(hkil(1) + hkil(2));
hkil(4) = hkl(3);
% account for lattice vector lengths
hkil(1:3) = hkil(1:3) / (2/(sqrt(3)*cryst.latticepar(1)));
hkil(4) = hkil(4) / (1/cryst.latticepar(3));
hkil(1:3) = hkil(1:3) / (2/(sqrt(3)*parameters.cryst(phaseid).latticepar(1)));
hkil(4) = hkil(4) / (1/parameters.cryst(phaseid).latticepar(3));
misorientation_axis_hex=hkil;
out.mis_axis_hex = misorientation_axis_hex;
out.sym = sym;
out.sym = sym;
out.center1 = grain{grain1}.center/pxsize;
out.center2 = grain{grain2}.center/pxsize;
out.distc = norm(out.center1-out.center2);
gtDBConnect();
[int, x, y] = mym(['select avintint, avbbXsize, avbbYsize from ' parameters.acq.pair_tablename ' where grainID = ',num2str(grain1)]);
out.avgint1 = mean(int);
out.avgbbx1 = mean(x);
out.avgbby1 = mean(y);
[int, x, y] = mym(['select avintint, avbbXsize, avbbYsize from ' parameters.acq.pair_tablename ' where grainID = ',num2str(grain2)]);
out.avgint2 = mean(int);
out.avgbbx2 = mean(x);
out.avgbby2 = mean(y);
%
% %even if we have only one grain, can deal with the boundary plane
......@@ -174,8 +197,8 @@ out.sym = sym;
% hkil(3) = -(hkil(1) + hkil(2));
% hkil(4) = hkl(3);
% % account for lattice vector lengths
% hkil(1:3) = hkil(1:3) / (2/(sqrt(3)*cryst.latticepar(1)));
% hkil(4) = hkil(4) / (1/cryst.latticepar(3));
% hkil(1:3) = hkil(1:3) / (2/(sqrt(3)*parameters.cryst(phaseid).latticepar(1)));
% hkil(4) = hkil(4) / (1/parameters.cryst(phaseid).latticepar(3));
%
% gb_norm_hex_grain1=hkil;
% else
......@@ -191,8 +214,8 @@ out.sym = sym;
% hkil(3) = -(hkil(1) + hkil(2));
% hkil(4) = hkl(3);
% % account for lattice vector lengths
% hkil(1:3) = hkil(1:3) / (2/(sqrt(3)*cryst.latticepar(1)));
% hkil(4) = hkil(4) / (1/cryst.latticepar(3));
% hkil(1:3) = hkil(1:3) / (2/(sqrt(3)*parameters.cryst(phaseid).latticepar(1)));
% hkil(4) = hkil(4) / (1/parameters.cryst(phaseid).latticepar(3));
% gb_norm_hex_grain2=hkil;
% else
% gb_norm_hex_grain2=[];
......
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