MTEX-VPSC-MTEX Error/my mistake

815 views
Skip to first unread message

Suresh Kodukula

unread,
Jan 3, 2017, 4:18:45 PM1/3/17
to MTEX
Dear all, 

I am doing vpsc simulation for texture prediction. Initially, exporting data of ODF (measured data through XRD and calculated through MTex) to VPSC format and then doing simulations. Later importing the VPSC texture as ODF. It works good but I found the intensities are completely of different order. 

I tried just simply MTEX (odf) - VPSCformat - Import into MTEX . plotting the ode's there has been 2-3 times the order difference in intensities ? Is it bug/my mistake. Below is the code.

Please help me. I am attaching the ODF and the code and the ode's obtained before and after (export and import).

Best Regards,
Suresh.


%% Specify Crystal and Specimen Symmetries

 

addpath /Users/sureshk/Documents/mtex-4.4.beta.1

startup_mtex;

 

% crystal symmetry

CS = crystalSymmetry('m-3m', [1 1 1]);

 

% specimen symmetry

SS = specimenSymmetry('orthorhombic');

 

%%

 

addpath '/Users/sureshk/Documents/NewP812/res'

 

load odfD1or;

 

export_VPSC(odfD1or,'odfD1TEX.txt','points',1200);

 

pname = '/Users/sureshk/Documents/NewP812/artno1/Chk-1';

A1 = [pname '/odfD1TEX.txt'];

 

%% Import the Data

 

% specify kernel

psi = deLaValeePoussinKernel('halfwidth',10*degree);

 

%% Import the VPSC-Simulation data - Sample A

 

% create an EBSD variable containing the data

 

odfD1ret = loadODF(A1,CS,SS,'density','kernel',psi,'resolution',5*degree,...

  'interface','generic',...

  'ColumnNames', { 'phi1' 'Phi' 'phi2' 'Weight'}, 'Bunge');

 

save odfD1ret odfD1ret;

 

figure(1); plotSection(odfD1or, 'phi2', [0, 30, 45]*degree); mtexColorbar;

saveFigure('OdfBefore-VPSC-Conversion');

 

figure(2); plotSection(odfD1ret, 'phi2', [0, 30, 45]*degree);mtexColorbar;

saveFigure('OdfAfter-VPSC-Conversion');


odfD1ret.mat
vpsc_tomtex_chk.m
OdfAfter-VPSC-Conversion.png
OdfBefore-VPSC-Conversion.png
odfD1or.mat

Ralf Hielscher

unread,
Jan 10, 2017, 6:07:15 AM1/10/17
to MTEX
Hi Suresh,

thank you very much for your question. It allowed to detect me a serious bug. Which will be fixed in the the minor release. I also thought about your problem in general and I think a came up with a much better solution for exporting / importing ODFs for VPSC modelling:

1. When you computed your ODF from pole figures the have already the structure of individual orientations + weights. Using those for export removes an additional discretization error. The important point is to export the weights here as well

export_VPSC(odfD1or.components{1}.center,'odfD1TEX.txt','weights',odfD1or.components{1}.weights);

2. When importing the data choose the same kernel as your original ODF had.

psi = odfD1or.components{1}.psi;

3. When importing the data with potentially different orientations make sure to set the option 'density' and load the column 'weights' as well [not 'Weight' by the way].
 
odfD1ret = loadODF(A1,CS,SS,'density','kernel',psi,'interface','generic','ColumnNames', {'phi1' 'Phi' 'phi2' 'weights'}, 'Bunge');

Please report how this works for you.

Ralf.

Suresh Kodukula

unread,
Jan 11, 2017, 3:39:40 AM1/11/17
to MTEX
Dear Ralf,

I modified the code accordingly. This time i tried on 2 ode's from my data and it worked brilliant.
Pictures are attached for clarity.

Best Regards,
Suresh.
ODFA1-AfterExport-VPSC7.png
ODFA1-BeforeExport-VPSC7.png
ODFA21-AfterExport-VPSC7.png
ODFA21-BeforeExport-VPSC7.png

grandr...@gmail.com

unread,
Jan 20, 2017, 10:29:04 PM1/20/17
to MTEX
Is it possible to reduce the number of points exported by sacrificing some of the accuracy of the data (similar to the 'points' command)?  I have an output of 10k points in the .txt file using the above procedure, but ideally, I'd like to output the VPSC data with ~1000 points to speed up processing for trial runs before I use the full data for a final run.

Regards, Jessica

ruediger Kilian

unread,
Jan 21, 2017, 10:30:54 AM1/21/17
to MTEX
Hi Jessica,
there’s discreteSample for almost a lot of things in mtex or if you need something more general you could use a function like this one:
function [id]=randSample(len,ntrue)
% produce a logical of length len
% with number ntrue of ones
id = [ ones(1,ntrue) zeros(1,len-ntrue) ];
id = id(randperm(len));

Maybe this helps.
And yes, orientation/export is rather slow, I guess that’s because it uses cprintf.

Cheers,
Rüdiger


On 21 Jan 2017, at 4:29 am, <grandr...@gmail.com> <grandr...@gmail.com> wrote:

> Is it possible to reduce the number of points exported by sacrificing some of the accuracy of the data (similar to the 'points' command)? I have an output of 10k points in the .txt file using the above procedure, but ideally, I'd like to output the VPSC data with ~1000 points to speed up processing for trial runs before I use the full data for a final run.
>
> Regards, Jessica
>
> --
> If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
> ---
> You received this message because you are subscribed to the Google Groups "MTEX" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com.
> Visit this group at https://groups.google.com/group/mtexmail.
> For more options, visit https://groups.google.com/d/optout.

grandr...@gmail.com

unread,
Feb 22, 2017, 2:40:34 PM2/22/17
to MTEX, ruedige...@unibas.ch
Here's what worked for me.  It's a basic solution but didn't occur to me at first so I put it up here for reference.  Since the original exported text file had 10k entries which would really slow down VPSC, I needed to cut it down.  It occurred to me that some of the entries/orientations would have a very low weight, and by eliminating these I could really reduce the file without removing much texture information.  This was confirmed by histogram(pf_rot.components{1}.weights)  I used the code below to cut things down, which gives an output of ~1600 lines to the text file.  There's some intensity change, but a good compromise.

%load all weights with a value greater than 0.0001 into a new variable
weights= pf_rot.components{1}.weights (pf_rot.components{1}.weights>0.0001)
 
%do the same for the center values that correspond
centers= pf_rot.components{1}.center (pf_rot.components{1}.weights>0.0001)
 

export_VPSC(centers,'odfAZ80-5D.txt','weights', weights);

 

Reply all
Reply to author
Forward
0 new messages