Bragg Edge Modeling

The following tutorial will guide, step by step, in a full Bragg Edge Modeling


Input file

You will need a VDrive file (vdrive_filename.txt) generated by the VULCAN instrument. This file should looks like this

Python code

You need to clone the bragg edge repository (this won’t be necessary as soon as the library has been deployed).

Step 1 - Prepare VDrive file

In order to run the VDrive file through the Matlab code (step 2), we need to change the format of this file. To do so simply run the following command line (make sure you provide your own file path)

NB: Add braggedgemodeling repo to python path !

> python braggedgemodeling/scripts/
    -i <full path to the vdrive filename.txt>
    -io <specify full filename of an intermediate file>
    -o <full path to output file, prefered extension .rpf>


> python scripts/
    -i ~/Desktop/vdrive_filename.txt
    -o ~/Desktop/VULCAN.rpf
    -io ~/Desktop/intermediate_file

Here is what the output file should look like

Step 2 - Matlab code

  • Right now, this code only works on VULCAN2 computer, so connect to

  • From there, launch Matlab2014a as this version is the only working for the code we are going to use.

  • Within Matlab, move to folder /usr/local/mtex-3.5.0
  • start startup_mtex from the Matlab command

  • We need to import the pole figure (file created in Step 1),
    • click the Import pole figure data blue line
    • click + to select input file (~/Desktop/VULCAN.rpf)
    • click Next >> and select Crystal Coordinate System Laue Group _ click several times Next >> or just Finish

  • A matlab script is created, make sure the specimen symetry is the one you specified in the GUI (BUG in the Matlab program!!!). If incorect, make sure you edit the file and replace it with the orientation you choosed.

  • Save the file and Run it. This will produce a few variables listed in the workspace window (right side of Matlab UI).

  • We need to create now the ODF file by just entering the following script in Matlab command line

  • And now the final step where we need to export the ODF data. But we first need to specify the number of graind orientation (default 5000) by editing the export_vPSC1 file.

FIX ME!!! find a way to make this script available to user (put it inside the mtex code

  • Run the export_vPSC1 script from Matlab command line

And here is the final file created, texture.txt