26.12.2013 Views

Coherent Backscattering from Multiple Scattering Systems - KOPS ...

Coherent Backscattering from Multiple Scattering Systems - KOPS ...

Coherent Backscattering from Multiple Scattering Systems - KOPS ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Evaluation of the small angle data<br />

Evaluation of the small angle data<br />

The following MATLAB code is a very simplified version of the evaluation program for the<br />

small angle setup; it will not work with all data. The script finds the backscattering direction<br />

θ = 0 in the CCD image and calculates either an azimuthal average or a radial profile section<br />

of the backscattering cone.<br />

The signals of the CCD chip and their errors (se = standard error) are stored in two uint16<br />

binary files. Depending on the preprocessing the numbers can have big (ieee-be) or little<br />

(ieee-le) endian.<br />

function small_angle_evaluation<br />

%% Open file<br />

endian = ’ieee-be’ ;<br />

% alternative: ’ieee-le’<br />

fid = fopen (’C:\Examples\example.i16’, ’r’) ;<br />

matrix = fread (fid, [2048,2048], ’uint16’, 0, endian) ;<br />

fclose (fid) ;<br />

fid = fopen (’C:\Examples\example_se.i16’, ’r’) ;<br />

errormatrix = fread (fid, [2048,2048], ’uint16’, 0, endian) ;<br />

fclose (fid) ;<br />

%% Find peak<br />

% the image has to be scaled to have intensities in [0,1] by dividing by the<br />

% largest possible intensity (i.e. 65535)<br />

dummy = matrix / 65535 ;<br />

% turn matrix into black-and-white picture (conetip forms white blob,<br />

% everything else is black)<br />

n = 5 ;<br />

dummy = medfilt2 (dummy, [n,n]) ;<br />

maximum = max ( max (dummy) ) ;<br />

level = 0.95 * maximum ;<br />

bwimage = im2bw (dummy, level) ;<br />

% smooth picture so that fluctuations do<br />

% not disturb the search for the cone<br />

% find center of the blob => scattering angle theta = 0<br />

dummy = bwlabel (bwimage) ; % label connected components in binary image<br />

regions = regionprops (dummy, ’Area’, ’Centroid’) ; % measure properties<br />

% of image regions<br />

[area,index] = max ( [ regions.Area ] ) ;<br />

87

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!