Allen J. Hall

Materials Science & Engineering, Productivity, and Life

Part II: Matlab XRD- reciprocal space maps from XPert XRD files (.x00)

A series of MATLAB functions will follow. Some of these “.m” files call each other, so ensure you have all of them before you start.

The purpose of this file is to load in all the .x00 files in a directory of Omega-Omega-2-Theta slices for reciprocal space mapping of a sample. Please note that as of this writing, the data has not yet been converted to Q-space.

The first function loads data into your workspace for a directory of .x00 files that have a common base filename. The user needs to supply the first index number and last index number for loading the files. The program then attempts to load “filenameIndex.x00″ in a linear fashion for all .x00 files of that filename indexed in the cd’d directory. [Change directory to the working directory needed before starting this function.]


You can download this file as a text file here: dirload.m, revision 8

function [mydata, myx] = dirload(filename,startnum,stopnum);

%%  version written on Wednesday; October 1, 2008
%%
%%  This function was written by Allen J. Hall
%%  allen@allenjhall.com
%%  http://www.allenjhall.com/content/
%%  Free to use in part or full.
%%  However, the following must remain free and not be paid for.
%%  (creative commons copyright may apply)
%%
%%  (oh, btw, you get what you pay for- this isn't perfect!!)


% Let's preload a single dataset to see the length that we require.
[DataTemp, XTemp] = loadx00(sprintf('%s%i.x00',filename,startnum));

% Total number of scans
NumScans = stopnum - startnum;                       

% what's the size of the first one??
%fprintf(1, 'Data size for DataTemp for Scan #%i is:', startnum);
%DataTemp
datasize = size(DataTemp);
%fprintf(1, 'Data size for DataTemp for Scan #%i is:', startnum);
xsize = size(XTemp);

fprintf(1,'Loading Data From Directory...\n');
datacounter = 0;

for i = startnum:stopnum
  [DataTemp, XTemp] = loadx00(sprintf('%s%i.x00',filename,i));
%fprintf(1, 'After Loading Scan #%i, DataTemp size is:', i);
size(DataTemp);
  datacounter = datacounter+1;
  datatemp = DataTemp;
  mydata(:,datacounter) = datatemp; 
  myx(:,datacounter) = XTemp;
end

Post a Comment

Your email is never shared. Required fields are marked *

*
*

A Quick Introduction...

I'm a graduate student (PhD Candidate) at the University of Illinois at Urbana-Champaign.

I've studied and researched in two fields of Materials Science and Engineering (Polymers and Semiconductors). My interests are as diverse as my musical tastes and I usually have my hand in some crazy project during my free time.

I'm available for consulting and have access to a world-renown materials research user-facility supported by the D.O.E. If you would like to know more, please contact me.

Popular Tags

Amazon Associate Link Apple Support AppStore Bug CIGS CIS CLI Conferences Cross Platform Data Mining data visualization dual-driver headphones failure Friend Geek Tool Great Scientists HAM Radio Hardware Tips How To Humanitarian IEM IM In-Ear Monitors iPod Touch LaTeX Linux Mac OsX Materials Science and Engineering Matlab Obituary Open Source problem Productivity reciprocal space return Silent Key Software Software Review Support This Blog Thesis Writing Tip UIUC VOIP Windows xrd

Support This Blog

You can support this blog by shopping on Amazon through my Affiliate Store.