mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
287 stars 185 forks source link

Bug: \bar{0} after symmetrise #694

Closed matheusGariglio closed 3 years ago

matheusGariglio commented 3 years ago

Hi!

I'm currently having a little problem while plotting IPFs for the HCP titanium alpha phase.

The orientations seem to be write, but I'm getting -0 values, as you can see below :

ebsd2 = ebsd;
IPFXa = ipfHSVKey(ebsd2('Alpha'));
figure; plot(IPFXa)

image

This also happens when doing:

o_A = ebsd2('Alpha').orientations;
figure; plotIPDF(o_A,[vector3d.X,vector3d.Y,vector3d.Z],'contourf')

image

I'm using the 5.5.0 version, but I've also tested it on the latest version.

I would like to know if this is some kind of bug or if it is something linked to my coding.

I'm sending you one example of my data in the following link : [https://cloud.mines-paristech.fr/index.php/s/fOHrkiBmfURtqEU]

Kind regards, Matheus

kilir commented 3 years ago

Hi, I'm not entirely sure what you'd like to achieve. Do you want to plot an EBSD map or colored points? Or something else? You data loads fine and ipf plots or maps are plotting fine for me. Cheers, Rüdiger

matheusGariglio commented 3 years ago

Hi Rüdiger,

First of all, thanks for your quick answer and happy new year :)

Actually, the data is fine for me. The only problem are those negative zeros appearing in the triangle edges, as [-00-01] instead of simply [0001]. Is this some kind of bug?

Cheers, Matheus

kilir commented 3 years ago

Hi Matheus, sorry I did not get this, now I see what you mean.

ipfplot key

Above is what I get.

What does plotHKL(o_A.cs) give ?

Cheers, Rüdiger

matheusGariglio commented 3 years ago

Hi Rüdiger,

No worries.

When I do exactly as you said, I get :

plotHKL(o_A.cs)


Unrecognized method, property, or field 'cs' for class 'orientation'.

Error in rotation/subsref (line 22) [varargout{1:nargout}] = builtin('subsref',r,s);



However, doing CS in capital letters :

`>> plotHKL(o_A.CS)`

I get :
![image](https://user-images.githubusercontent.com/77332633/104326727-56c89b00-54ea-11eb-8ca9-d13680e8cd35.png)
kilir commented 3 years ago

Hi, sorry, the cs instead of CS was of course a typo. I can confirm that your observation relates to a bug when directions are excessively potted on top of each other and should be fixed soon. To reproduce the issue: plot(Miller(0,0,0,1,crystalSymmetry('622'),'uvw'),'labeled','symmetrised','lower') Cheers, Rüdiger

matheusGariglio commented 3 years ago

Hi Rüdiger,

Yes, I just thought that maybe in the latest version (5.6.0) it was changed to cs.

Ok, thank you!

Cheers, Matheus

kilir commented 3 years ago

Hi, I reopen this because I think it's a bug related to a rounding during symmetrise. \bar{0} should not be assigned if 0 is sufficiently close to zero. Didn't we have something similar before (https://github.com/mtex-toolbox/mtex/discussions/575)?

To reproduce the issue:

h = symmetrise(Miller(0,0,0,1,crystalSymmetry('622')),'unique')
char(h(2),'LaTeX')

'$(\bar{0}\bar{0}0\bar{1})$'

Hopefully fixed in aadec2799421b98a7e71d761d4585246058e4f9b

Cheers, Rüdiger

matheusGariglio commented 3 years ago

Hi Rüdiger,

I've tested after this bug fix and it's working fine for me.

Thanks a lot!

Cheers, Matheus