Yet another GND related question

331 views
Skip to first unread message

MTEXNewbie

unread,
Jun 14, 2018, 6:45:11 AM6/14/18
to MTEX
Hi All,

This is the code I have used, which has been suggested by forum members before -

ebsd2 = ebsd('Iron fcc').gridify;
gnd = calcGND(ebsd2);
plot(ebsd2,gnd)

As stated by Bobin in this thread, I have many NaN values in the GND matrix and warnings on symmetry mismatch are shown on the command tab.

Now,
1. How do I get the GND density after applying the above code?
2. How to calculate GND density of grain interiors using MTEX?

Thank you.

Ralf Hielscher

unread,
Jun 15, 2018, 3:26:06 AM6/15/18
to MTEX
Hi,

finally GND computation is done right in MTEX. Checkout



Ralf.

MTEXNewbie

unread,
Jun 15, 2018, 10:20:35 AM6/15/18
to MTEX
Hi Ralf,

Great work once again by a prompt update to MTEX, and thank you for providing detailed GND demo. Couple questions -

1. The grains were reconstructed for 5 and later 2.5-degree threshold. Generally, we do Grain reconstruction for 15 degrees. Why such a small angle?

2. The script GND_demo.m executes fine until Line 327, do we must upgrade to MATLAB 2018a or is there a way to run this properly in 2016b?


PS: It is recommended to use the latest available MATLAB B release (September), e.g. MATLAB 2016b or 2017b, since it contains bug fixes of the A release (March). University IT dept deploys a B release and maintains it for 1-2 years, so it will be helpful to keep MTEX fully compatible up to 2 release years back (2016b full compatibility for MTEX released in 2018 and so on). This is just my personal opinion dealing with IT dept bureaucracy. :)

Ralf Hielscher

unread,
Jun 15, 2018, 2:30:34 PM6/15/18
to MTEX
Hi Rashed,

1. The grains were reconstructed for 5 and later 2.5-degree threshold. Generally, we do Grain reconstruction for 15 degrees. Why such a small angle?


you can take whatever threshold you want. There is no specific reason. Maybe, one wants to exclude low angle grain boundaries from GND calculation.

2. The script GND_demo.m executes fine until Line 327, do we must upgrade to MATLAB 2018a or is there a way to run this properly in 2016b?


The script GND_demo.m is a demo - it is written with the idea that people read it. Have you read line 327? It tells you that it will only work in Matlab 2018a. But if you look at the line you also see that it sets the colorscale to be logarithmic. You can simply remove the line  - then you have a linear color scale. Or you put a log into the plotting command.

The approach in the script is the nicest - that's why I did it this way - but there are many workarounds. 


PS: It is recommended to use the latest available MATLAB B release (September), e.g. MATLAB 2016b or 2017b, since it contains bug fixes of the A release (March). University IT dept deploys a B release and maintains it for 1-2 years, so it will be helpful to keep MTEX fully compatible up to 2 release years back (2016b full compatibility for MTEX released in 2018 and so on). This is just my personal opinion dealing with IT dept bureaucracy. :)

I put a lot of effort in keeping MTEX backward compatible. Having a simple cosmetic command in a demo not working with previous Matlab versions I do not think to be a break in compatibility.

Ralf.
 

MTEXNewbie

unread,
Jun 15, 2018, 3:37:04 PM6/15/18
to MTEX
Hi Ralf,

you can take whatever threshold you want. There is no specific reason. Maybe, one wants to exclude low angle grain boundaries from GND calculation.

You are right, I tried GND_demo.m with 15-degree threshold and from the Orientation map it seems that LAGB's are getting excluded with a higher threshold value. One thing to note that LAGB's (subgrains) do not exist in annealed sample, whereas the example here (DC06_2uniax.ang) is pre-strained (2%). Would it be correct to say that LAGB's should be included in GND calculation because the LAGB's (dislocation cell walls or subgrains) have the same dislocation pile-up phenomena happening just as HAGB's?

But if you look at the line you also see that it sets the colorscale to be logarithmic. You can simply remove the line  - then you have a linear color scale. Or you put a log into the plotting command.

The approach in the script is the nicest - that's why I did it this way - but there are many workarounds. 

Thanks for the tip, I will try to make it work in 2016b using the above approach.

The addition of detailed GND calculation is going to be a valuable feature offered by MTEX, thank you for your hard work. MTEX has been an extremely helpful tool for me in learning crystallography. :)

MTEXNewbie

unread,
Sep 10, 2018, 12:33:18 PM9/10/18
to MTEX
Hi Ralf,

Is there a way to have minimum and maximum values (like pole figure) in GND map? I have put the command 'minmax' in line 274 of GND_demohttps://github.com/mtex-toolbox/mtex/blob/develop/doc/TensorAnalysis/GND_demo.m

plot(ebsd,factor*sum(abs(rho .* dSRot.u),2),'micronbar','off','minmax')

But it does not provide the expected min-max GND density.

ruediger Kilian

unread,
Sep 10, 2018, 1:35:59 PM9/10/18
to mtex...@googlegroups.com
Hi,
you can use `text`. For example

text(50, 50,{['min GND:' num2str(min(gnd))] , ['max GND:' num2str(max(gnd)) ]},'fontSize',18,'color','w','backGroundColor', 'k');

where 50,50 are the coordinates and gnd = factor*sum(abs(rho .* dSRot.u),2) for your case.

Cheers,
Rüdiger

MTEXNewbie

unread,
Sep 10, 2018, 2:06:11 PM9/10/18
to MTEX
Hi Rüdiger,

Unfortunately, it did not work. Is the 'minmax' option only available in Spherical Projections?

Rüdiger Kilian

unread,
Sep 11, 2018, 5:10:13 AM9/11/18
to mtex...@googlegroups.com
Hi,
could you pleae specify what did not work? What did you write?
Cheers,
Rüdiger

MTEXNewbie

unread,
Sep 11, 2018, 8:10:02 AM9/11/18
to MTEX
This is what I wrote -

gnd = factor*sum(abs(rho .* dSRot.u),2);
text(50, 50,{['min GND:' num2str(min(gnd))] , ['max GND:' num2str(max(gnd))]},'fontSize',18,'color','w','backGroundColor','k');

Only the skeletal grain boundary plot shows up.

ruediger Kilian

unread,
Sep 11, 2018, 8:38:29 AM9/11/18
to mtex...@googlegroups.com
Here's a simple example that works for me, e.g. plotting the text in the center of the map:

mtexdata titanium
grains=ebsd.calcGrains;
someprop = ebsd.prop.iq;
plot(ebsd,someprop)
hold on
plot(grains.boundary)
hold off
text(450, 450,{['min some property:' num2str(min(someprop))] , ['max some property:' num2str(max(someprop)) ]},'fontSize',18,'color','w','backGroundColor', 'k');

Cheers,
Rüdiger

MTEXNewbie

unread,
Sep 13, 2018, 6:00:23 AM9/13/18
to MTEX
Your code works as it is but not in the GND code.
The variable "gnd" outputs data for each pixel and there are lots of NaN, I was wondering if this has something to do with min and max calculation error?

ruediger Kilian

unread,
Sep 13, 2018, 6:55:33 AM9/13/18
to mtex...@googlegroups.com
Hi,
in that case use nanmax und nanmin.
Cheers,
Rüdiger

MTEXNewbie

unread,
Sep 14, 2018, 9:39:46 AM9/14/18
to MTEX
Thank you, but still the same, only the grain boundary network shows up.

gnd = factor*sum(abs(rho .* dSRot.u),2);
text(50, 50,{['min GND:' num2str(nanmin(gnd))] , ['max GND:' num2str(nanmax(gnd))]},'fontSize',18,'color','w','backGroundColor','k');


Reply all
Reply to author
Forward
0 new messages