Code covered by the BSD License  

Highlights from
spec file reader

image thumbnail
from spec file reader by Zhang Jiang
Monitor, read, save scans from SPEC files and calculate true reflectivity.

convert2theta2qz(varargin)
function convert2theta2qz(varargin)
hFigSpecr = findall(0,'Tag','specr_Fig');
hPopupmenuX = findall(hFigSpecr,'Tag','specr_PopupmenuX');
hPopupmenuY = findall(hFigSpecr,'Tag','specr_PopupmenuY');
hPopupmenuPlotStyle = findall(hFigSpecr,'Tag','specr_PopupmenuPlotStyle');
hAxes = findall(hFigSpecr,'Tag','specr_Axes');
hLine = findall(hAxes,'Type','line');
settings = getappdata(hFigSpecr,'settings');
wavelength = settings.wavelength;
file = settings.file;
scan = settings.scan;
if isempty(file) | isempty(scan) | ~isfield(scan,'selectionIndex') | isempty(scan.selectionIndex)
    return;
end
for iLine = 1:length(hLine)
    set(hLine(iLine),'XDATA',4*pi/wavelength*sin(pi/180*abs(get(hLine(iLine),'XDATA')))/2);
end
set(hAxes,'XLabel',text('String','Qz(A^{-1})'));

Contact us at files@mathworks.com