Closed zmichels closed 5 months ago
Additional info: All mtex_settings for plotting conventions are set the same when running each version.
I'm not sure what changed since 5.10.2, and I am hoping I can figure that outin order to make any necessary modifications. Unless it is some bug. It seems like a "bug" in that identical code produces different results.
Plotting all the eigenvectors of the grain-scale orientation dispersion using the different versions of MTEX...
5.10.2:
5.11.2
The following code produces a set of orientations dispersed about the Z-axis and computes a covariance matrix and associated tensor.
However, the results in 5.11.2 are different than previous versions.
%% setup
cs = loadCIF('olivin');
h = [Miller(1,0,0,'direction',cs),Miller(0,1,0,'direction',cs),Miller(0,0,1,'direction',cs)];
o = orientation('map',vector3d.X, vector3d.Z, cs);
%% dispersion range
dispAx = vector3d.Z;
numOrs = 1000;
maxAng = 60;
dispMin = 1;
dispMax = round((maxAng-dispMin).*rand + dispMin);
dispRange = (dispMax-dispMin).*rand(numOrs,1) + dispMin;
% noise to add
nzMin = 1;
nzMax = (dispMax/2-nzMin).*rand + .1;
nzRange = (nzMax-nzMin).*rand(numOrs,1) + nzMin;
r1 = rotation('axis',dispAx,'angle',dispRange*degree);
r2 = rotation('axis',vector3d.rand(numOrs),'angle',nzRange*degree);
ors = r2.*r1.*o;
dOrs = ors(:,1);
%% plot the model-dispersion of orientations
figure,
plotPDF(dOrs,h,'antipodal','lower','smooth','halfwidth',10*degree,'colorrange','equal')
%% principal geodesic analysis
% mean / center
oriRef = mean(dOrs);
% compute the projection of orientations onto the three dimensional
% tangential space centered about the mean
t = log(dOrs, oriRef,'left');
% covariance matrix as tensor
T = tensor(t*t,'rank',2);
%% plot the tensor
figure,
plot(T)
The dispersed orientations:
5.10.2 dispersion tensor:
Note that the maxima in the plot matches the Z-axis direction used for modeling the dispersion.
That is unlike the result from 5.11.2:
here is a link to the data I am using, generated by the code above.
It seems the result of variable 't' in 5.10.2 was a vector3d object, whereas in 5.11.2, the result is a Miller object
https://drive.google.com/drive/folders/1MidpkAAxBYl7r7-J_fdGHyrSbYHZScDe?usp=sharing
Hi Zach,
if you replace in
t = log(dOrs, oriRef,'left');
'left'
by SO3TangentSpace.leftVector
you should get the expected result.
I think we should make it possible to still use the old left
syntax.
Ralf.
@ralfHielscher Excellent! Thank you. Will this work with all current versions?
@ralfHielscher This works great for 5.11.2, but it throws an error in 5.10.2
Is there a method to query which mtex version is being used, such that I can switch between sytaxes?
You can do
getMTEXpref('version')
Ralf.
Hi Zach,
if you replace in
t = log(dOrs, oriRef,'left');
'left'
bySO3TangentSpace.leftVector
you should get the expected result.I think we should make it possible to still use the old
left
syntax.Ralf.
Hi @ralfHielscher, Do you think it will be possible if future releases to include support for the legacy 'left' syntax?
What do you want to do? Compute an orientation dispersion analysis using code (from CVA toolbox I maintain) that worked in MTEX versions 4.X-5.10.X
What data do you have? mtexdata forsterite
What code do you use?
Code for Principal Geodesic Analysis (PGA) available here: https://github.com/zmichels/CVA
Please provide minimalist code with code in the following form
What result do you get I get completely different results in 5.11.2 than any previous versions of MTEX
What result do you expect I expect the results to match those achieved with previous versions
What MTEX version do you use? 5.11.2