552 lines
28 KiB
Matlab
552 lines
28 KiB
Matlab
function hdl = nappPlot(DataTable,varargin)
|
|
%nappPlot is the one-and-only function to plot PE spectra and images.
|
|
%
|
|
% nappPlotXps(FileList,tmpDataSelection)
|
|
%
|
|
% *input*
|
|
% FileList: data table
|
|
% tableSelection (optional): logical array to filter data table
|
|
% tableVariable (optional): select what to plot: image(default),'imageRoh','spectrum_countsPerSecond','spectrum_counts','spectrum_countsNorm'
|
|
% energyScale: kinetic (default) or binding, energy scale to be used for
|
|
% plots.
|
|
% mode: AllInOne (default) all spectra are plotted in one figure, images
|
|
% are plotted in one figure each; OneEach: all spectra are plotted in one
|
|
% figure each; iterations: each spectrum is plotted in one figure each
|
|
% showing the individual sequence iterations.
|
|
% plotStep, default 1: Specify the i-th iterations that should be
|
|
% plotted.
|
|
%
|
|
%
|
|
% *output*
|
|
% just a figure, with handle.
|
|
%% TODO
|
|
%
|
|
% TODO: Add averaging in image and in iteration plot
|
|
% TODO: Make code nicer (NEXAFS plotting)
|
|
|
|
% Define conditions and defaults of input
|
|
defaultTableVariable = 'image';
|
|
expectedTableVariable = {'image','imageRoh','spectrum_countsPerSecond','spectrum_counts','spectrum_countsNorm'};
|
|
defaultMode = 'AllInOne';
|
|
expectedMode = {'AllInOne','OneEach','iterations'};
|
|
defaultFigureMode = 'screen';
|
|
expectedFigureMode = {'screen','powerpoint','word'};
|
|
defaultEnergyScale = 'kinetic';
|
|
expectedEnergyScale = {'kinetic','binding','xRay'};
|
|
defaultTableSelection = true(size(DataTable,1),1);
|
|
defaultPlotStep = 1;
|
|
|
|
% Parse input
|
|
p = inputParser;
|
|
addRequired(p,'DataTable',@istable);
|
|
addOptional(p,'tableSelection',defaultTableSelection,@islogical);
|
|
addParameter(p,'tableVariable',defaultTableVariable,...
|
|
@(x) any(validatestring(x,expectedTableVariable)));
|
|
addParameter(p,'mode',defaultMode,...
|
|
@(x) any(validatestring(x,expectedMode)));
|
|
addParameter(p,'figureMode',defaultFigureMode,...
|
|
@(x) any(validatestring(x,expectedFigureMode)));
|
|
addParameter(p,'energyScale',defaultEnergyScale,...
|
|
@(x) any(validatestring(x,expectedEnergyScale)));
|
|
addParameter(p,'plotStep',defaultPlotStep);
|
|
parse(p,DataTable,varargin{:});
|
|
|
|
if ~all(cell2mat(cellfun(@size,p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable),'UniformOutput',false)),'all')
|
|
disp('The table variable appears to be empty. I quit now')
|
|
error('The table variable appears to be empty.')
|
|
end
|
|
|
|
|
|
% make figure, with options for output.
|
|
if contains(p.Results.figureMode ,'screen') % standard
|
|
alw = get(groot,'DefaultAxesLineWidth');
|
|
fsz = get(groot,'DefaultAxesFontSize');
|
|
lw = 2; %get(groot,'DefaultLineLineWidth');
|
|
fnt = get(groot,'DefaultAxesFontName');
|
|
loc = 'northeastoutside';
|
|
unt = 'pixels';
|
|
pos = [20 100 800 500];
|
|
|
|
elseif contains(p.Results.figureMode,'powerpoint')
|
|
alw = 2;
|
|
fsz = 26;
|
|
lw = 4;
|
|
fnt = 'Helvetica Neue';
|
|
loc = 'northeastoutside';
|
|
unt = 'pixels';
|
|
pos = [300 200 1280 720];
|
|
|
|
elseif contains(p.Results.figureMode,'word')
|
|
alw = 0.75;
|
|
fsz = 10;
|
|
lw = 0.5;
|
|
fnt = 'Helvetica Neue';
|
|
loc = 'southoutside';
|
|
unt = 'centimeters';
|
|
pos = [8 10 8 10];
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if matches(p.Results.tableVariable,'image')
|
|
for ii = 1:size(p.Results.DataTable(p.Results.tableSelection,:),1)
|
|
if endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'h5') % let's do NEXAFS first.
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
% Try to plot image with x and y
|
|
try
|
|
% interpolate, to have equal x spacing for image plot
|
|
Xq = p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii}(1):0.1:p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii}(end);
|
|
Vq = interp2(p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii},p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},Xq,p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii});
|
|
image(Xq,p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii},...
|
|
Vq,'Parent',gca,'CDataMapping','scaled');
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
xlim([p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii}(1) p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii}(end)]);
|
|
ylim([p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRange_eV(ii,1) p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRange_eV(ii,2)]);
|
|
hXLabel = xlabel('Photon energy [eV]');
|
|
hYLabel = ylabel('Auger energy [eV]');
|
|
% if this does not work, plot without scaling (just with row and column numbers)
|
|
catch
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},'Parent',gca,'CDataMapping','scaled');
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
ylim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},1)]);
|
|
xlim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)]);
|
|
hXLabel = xlabel('# Photon energy, column number');
|
|
hYLabel = ylabel('# Auger energy, column number');
|
|
end
|
|
|
|
box(gca,'on');
|
|
if ~matches(p.Results.figureMode,'word')
|
|
title(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'Interpreter','none')
|
|
end
|
|
set( gca, ...
|
|
'FontName' , fnt,'FontSize' , fsz );
|
|
set([hXLabel, hYLabel], ...
|
|
'FontName' , fnt);
|
|
set([hXLabel, hYLabel] , ...
|
|
'FontSize' , 1.2*fsz );
|
|
|
|
set(gca, ...
|
|
'Box' , 'off' , ...
|
|
'TickDir' , 'out' , ...
|
|
'TickLength' , [.02 .02] , ...
|
|
'XMinorTick' , 'on' , ...
|
|
'YMinorTick' , 'off' , ...
|
|
'XGrid' , 'on' , ...
|
|
'XColor' , [0 0 0], ...
|
|
'YColor' , [0 0 0], ...
|
|
'LineWidth' , alw );
|
|
elseif endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'ibw')
|
|
|
|
if contains(p.Results.energyScale,'kinetic')
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii},...
|
|
1:length(1:size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)),...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}',...
|
|
'Parent',gca,'CDataMapping','scaled');
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
ylim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)]);
|
|
xlim([p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii}(1) p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii}(end)]);
|
|
hXLabel = xlabel('Electron energy [eV]');
|
|
hYLabel = ylabel('Sequence iteration');
|
|
elseif contains(p.Results.energyScale,'binding')
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV{ii},...
|
|
1:length(1:size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)),...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}',...
|
|
'Parent',gca,'CDataMapping','scaled');
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
ylim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)]);
|
|
% xlim([p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV(ii,1) p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV(ii,2)]);
|
|
hXLabel = xlabel('Binding energy [eV]');
|
|
hYLabel = ylabel('Sequence iteration');
|
|
end
|
|
box(gca,'on');
|
|
existColumn = strcmp('sample',p.Results.DataTable.Properties.VariableNames);
|
|
if ~matches(p.Results.figureMode,'word')
|
|
if ~any(existColumn)
|
|
title([{p.Results.DataTable(p.Results.tableSelection,:).name{ii} p.Results.DataTable(p.Results.tableSelection,:).lastModifiedDatestr{ii}}],'Interpreter','none')
|
|
else
|
|
title([{p.Results.DataTable(p.Results.tableSelection,:).name{ii} p.Results.DataTable(p.Results.tableSelection,:).sample{ii} p.Results.DataTable(p.Results.tableSelection,:).lastModifiedDatestr{ii}}] ,'Interpreter','none')
|
|
end
|
|
end
|
|
set( gca, ...
|
|
'FontName' , fnt,'FontSize' , fsz );
|
|
set([hXLabel, hYLabel], ...
|
|
'FontName' , fnt);
|
|
set([hXLabel, hYLabel] , ...
|
|
'FontSize' , 1.2*fsz );
|
|
|
|
set(gca, ...
|
|
'Box' , 'off' , ...
|
|
'TickDir' , 'out' , ...
|
|
'TickLength' , [.02 .02] , ...
|
|
'XMinorTick' , 'on' , ...
|
|
'YMinorTick' , 'off' , ...
|
|
'XGrid' , 'on' , ...
|
|
'XColor' , [0 0 0], ...
|
|
'YColor' , [0 0 0], ...
|
|
'LineWidth' , alw );
|
|
end
|
|
end
|
|
end
|
|
if matches(p.Results.tableVariable,'imageRoh')
|
|
for ii = 1:size(p.Results.DataTable(p.Results.tableSelection,:),1)
|
|
if endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'h5') % let's do NEXAFS first.
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
% Try to plot image with x and y
|
|
try
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii},p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},'Parent',gca,'CDataMapping','scaled');
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
xlim([p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii}(1) p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii}(end)]);
|
|
ylim([p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRange_eV(ii,1) p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRange_eV(ii,2)]);
|
|
hXLabel = xlabel('Photon energy [eV]');
|
|
hYLabel = ylabel('Auger energy [eV]');
|
|
% if this does not work, plot without scaling (just with row and column numbers)
|
|
catch
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},'Parent',gca,'CDataMapping','scaled');
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
ylim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},1)]);
|
|
xlim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)]);
|
|
hXLabel = xlabel('# Photon energy, column number');
|
|
hYLabel = ylabel('# Auger energy, column number');
|
|
end
|
|
|
|
box(gca,'on');
|
|
set( gca, ...
|
|
'FontName' , fnt,'FontSize' , fsz );
|
|
set([hXLabel, hYLabel], ...
|
|
'FontName' , fnt);
|
|
set([hXLabel, hYLabel] , ...
|
|
'FontSize' , 1.2*fsz );
|
|
|
|
set(gca, ...
|
|
'Box' , 'off' , ...
|
|
'TickDir' , 'out' , ...
|
|
'TickLength' , [.02 .02] , ...
|
|
'XMinorTick' , 'on' , ...
|
|
'YMinorTick' , 'off' , ...
|
|
'XGrid' , 'on' , ...
|
|
'XColor' , [0 0 0], ...
|
|
'YColor' , [0 0 0], ...
|
|
'LineWidth' , alw );
|
|
elseif endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'ibw')
|
|
|
|
if contains(p.Results.energyScale,'kinetic')
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
existColumn = strcmp('scientaEkinRoh_eV',DataTable.Properties.VariableNames);
|
|
if any(existColumn)
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRoh_eV{ii},...
|
|
1:length(1:size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)),...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}',...
|
|
'Parent',gca,'CDataMapping','scaled');
|
|
xlim([p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRoh_eV{ii}(1) p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRoh_eV{ii}(end)]);
|
|
|
|
else
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii},...
|
|
1:length(1:size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)),...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}',...
|
|
'Parent',gca,'CDataMapping','scaled');
|
|
xlim([p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii}(1) p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii}(end)]);
|
|
|
|
end
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
ylim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)]);
|
|
hXLabel = xlabel('Electron energy [eV]');
|
|
hYLabel = ylabel('Sequence iteration');
|
|
elseif contains(p.Results.energyScale,'binding')
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
image(p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV{ii},...
|
|
1:length(1:size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)),...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}',...
|
|
'Parent',gca,'CDataMapping','scaled');
|
|
axis(gca,'ij');
|
|
set(gca,'Layer','top');
|
|
ylim([1 size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)]);
|
|
% xlim([p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV(ii,1) p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV(ii,2)]);
|
|
hXLabel = xlabel('Binding energy [eV]');
|
|
hYLabel = ylabel('Sequence iteration');
|
|
|
|
end
|
|
box(gca,'on');
|
|
|
|
existColumn = strcmp('sample',p.Results.DataTable.Properties.VariableNames);
|
|
if ~matches(p.Results.figureMode,'word')
|
|
if ~any(existColumn)
|
|
title([{p.Results.DataTable(p.Results.tableSelection,:).name{ii} p.Results.DataTable(p.Results.tableSelection,:).lastModifiedDatestr{ii}}],'Interpreter','none')
|
|
else
|
|
title([{p.Results.DataTable(p.Results.tableSelection,:).name{ii} p.Results.DataTable(p.Results.tableSelection,:).sample{ii} p.Results.DataTable(p.Results.tableSelection,:).lastModifiedDatestr{ii}}] ,'Interpreter','none')
|
|
end
|
|
end
|
|
set( gca, ...
|
|
'FontName' , fnt,'FontSize' , fsz );
|
|
set([hXLabel, hYLabel], ...
|
|
'FontName' , fnt);
|
|
set([hXLabel, hYLabel] , ...
|
|
'FontSize' , 1.2*fsz );
|
|
|
|
set(gca, ...
|
|
'Box' , 'off' , ...
|
|
'TickDir' , 'out' , ...
|
|
'TickLength' , [.02 .02] , ...
|
|
'XMinorTick' , 'on' , ...
|
|
'YMinorTick' , 'off' , ...
|
|
'XGrid' , 'on' , ...
|
|
'XColor' , [0 0 0], ...
|
|
'YColor' , [0 0 0], ...
|
|
'LineWidth' , alw );
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
if contains(p.Results.tableVariable,'spectrum')
|
|
if contains(p.Results.mode,'OneEach')
|
|
for ii = 1:size(p.Results.DataTable(p.Results.tableSelection,:),1)
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
if (contains(p.Results.energyScale,'kinetic') & endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'ibw'))
|
|
hplot = plot(p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}');
|
|
hplot.LineWidth = lw;
|
|
hXLabel = xlabel('Electron kinetic energy [eV]');
|
|
xlim([p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRange_eV(ii,1) p.Results.DataTable(p.Results.tableSelection,:).scientaEkinRange_eV(ii,2)]);
|
|
|
|
elseif (contains(p.Results.energyScale,'binding') & endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'ibw'))
|
|
hplot = plot(p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}');
|
|
hplot.LineWidth = lw;
|
|
hXLabel= xlabel('Binding energy [eV]');
|
|
xlim([min(p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy{ii}) max(p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV{ii})]);
|
|
|
|
elseif (contains(p.Results.energyScale,'xRay') | endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'h5'))
|
|
hplot = plot(p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii});
|
|
hplot.LineWidth = lw;
|
|
hXLabel = xlabel('Photon Energy eV');
|
|
xlim([p.Results.DataTable(p.Results.tableSelection,:).xRayEkinRange_eV(ii,1) p.Results.DataTable(p.Results.tableSelection,:).xRayEkinRange_eV(ii,2)]);
|
|
|
|
end
|
|
if contains(p.Results.tableVariable,'Norm')
|
|
hYLabel = ylabel('Counts [arb. unit]');
|
|
elseif contains(p.Results.energyScale,'xRay')
|
|
hYLabel = ylabel('partial A-M.E.Y.');
|
|
else
|
|
hYLabel = ylabel('Counts per second');
|
|
end
|
|
|
|
|
|
box(gca,'on');
|
|
existColumn = strcmp('sample',p.Results.DataTable.Properties.VariableNames);
|
|
if ~matches(p.Results.figureMode,'word')
|
|
if ~any(existColumn)
|
|
title([{p.Results.DataTable(p.Results.tableSelection,:).name{ii} p.Results.DataTable(p.Results.tableSelection,:).lastModifiedDatestr{ii}}],'Interpreter','none')
|
|
else
|
|
title([{p.Results.DataTable(p.Results.tableSelection,:).name{ii} p.Results.DataTable(p.Results.tableSelection,:).sample{ii} p.Results.DataTable(p.Results.tableSelection,:).lastModifiedDatestr{ii}}] ,'Interpreter','none')
|
|
end
|
|
end
|
|
|
|
set( gca, ...
|
|
'FontName' , fnt,'FontSize' , fsz );
|
|
set([hXLabel, hYLabel], ...
|
|
'FontName' , fnt);
|
|
set([hXLabel, hYLabel] , ...
|
|
'FontSize' , 1.2*fsz );
|
|
|
|
set(gca, ...
|
|
'Box' , 'off' , ...
|
|
'TickDir' , 'out' , ...
|
|
'TickLength' , [.02 .02] , ...
|
|
'XMinorTick' , 'on' , ...
|
|
'YMinorTick' , 'off' , ...
|
|
'XGrid' , 'on' , ...
|
|
'XColor' , [0 0 0], ...
|
|
'YColor' , [0 0 0], ...
|
|
'LineWidth' , alw );
|
|
|
|
end
|
|
end
|
|
|
|
if contains(p.Results.mode,'AllInOne')
|
|
% generate colormap
|
|
|
|
hdl = figure('Name','AllInOneSpectrum','units', unt,'Position',pos);
|
|
if size(p.Results.DataTable(p.Results.tableSelection,:),1) >= 7
|
|
tmp_color = colormap(parula(size(p.Results.DataTable(p.Results.tableSelection,:),1)));
|
|
else
|
|
tmp_color = colormap(lines(size(p.Results.DataTable(p.Results.tableSelection,:),1)));
|
|
end
|
|
if contains(p.Results.energyScale,'kinetic')
|
|
% axes('Parent',gcf,'XDir','reverse')
|
|
hold(gca,'on');
|
|
for ii = 1:size(p.Results.DataTable(p.Results.tableSelection,:),1)
|
|
if endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'ibw')
|
|
hplot = plot(p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}','DisplayName',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'Color',tmp_color(ii,:));
|
|
hplot.LineWidth = lw;
|
|
end
|
|
end
|
|
hXLabel = xlabel('Electron kinetic energy [eV]');
|
|
elseif contains(p.Results.energyScale,'binding')
|
|
axes('Parent',gcf,'XDir','reverse')
|
|
hold(gca,'on');
|
|
|
|
for ii = 1:size(p.Results.DataTable(p.Results.tableSelection,:),1)
|
|
if endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'ibw')
|
|
hplot = plot(p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}','DisplayName',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'Color',tmp_color(ii,:));
|
|
hplot.LineWidth = lw;
|
|
end
|
|
end
|
|
hXLabel= xlabel('Binding energy [eV]');
|
|
elseif contains(p.Results.energyScale,'xRay')
|
|
hold(gca,'on');
|
|
for ii = 1:size(p.Results.DataTable(p.Results.tableSelection,:),1)
|
|
if endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'h5')
|
|
hplot = plot(p.Results.DataTable(p.Results.tableSelection,:).xRayEkin_eV{ii},...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},...
|
|
'DisplayName',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'Color',tmp_color(ii,:));
|
|
hplot.LineWidth = lw;
|
|
end
|
|
end
|
|
hXLabel = xlabel('Photon Energy eV');
|
|
end
|
|
if contains(p.Results.tableVariable,'Norm')
|
|
hYLabel = ylabel('Counts [arb. unit]');
|
|
elseif contains(p.Results.energyScale,'xRay')
|
|
hYLabel = ylabel('partial A-M.E.Y.');
|
|
else
|
|
hYLabel = ylabel('Counts per second');
|
|
end
|
|
|
|
|
|
box(gca,'on');
|
|
if ~matches(p.Results.figureMode,'word')
|
|
title('PE Spectra','Interpreter','none')
|
|
hlegend = legend(p.Results.DataTable(p.Results.tableSelection,:).name{:});
|
|
hlegend.FontSize = fsz;
|
|
hlegend.Interpreter = 'none';
|
|
hlegend.Location = loc;
|
|
set(legend, 'Interpreter','none')
|
|
end
|
|
set( gca, ...
|
|
'FontName' , fnt,'FontSize' , fsz );
|
|
set([hXLabel, hYLabel], ...
|
|
'FontName' , fnt);
|
|
set([hXLabel, hYLabel] , ...
|
|
'FontSize' , 1.2*fsz );
|
|
|
|
set(gca, ...
|
|
'Box' , 'off' , ...
|
|
'TickDir' , 'out' , ...
|
|
'TickLength' , [.02 .02] , ...
|
|
'XMinorTick' , 'on' , ...
|
|
'YMinorTick' , 'off' , ...
|
|
'XGrid' , 'on' , ...
|
|
'XColor' , [0 0 0], ...
|
|
'YColor' , [0 0 0], ...
|
|
'LineWidth' , alw );
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
if contains(p.Results.mode,'iterations')
|
|
% generate colormap
|
|
|
|
for ii = 1:size(p.Results.DataTable(p.Results.tableSelection,:),1)
|
|
if endsWith(p.Results.DataTable(p.Results.tableSelection,:).name{ii},'ibw')
|
|
|
|
hdl = figure('Name',p.Results.DataTable(p.Results.tableSelection,:).name{ii},'units', unt,'Position',pos);
|
|
if size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2) >= 7
|
|
tmp_color = colormap(parula(size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)));
|
|
else
|
|
tmp_color = colormap(lines(size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)));
|
|
end
|
|
|
|
% Create axes
|
|
hold(gca,'on');
|
|
|
|
if contains(p.Results.energyScale,'kinetic')
|
|
for ij = 1:p.Results.plotStep:size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)
|
|
hplot= plot(p.Results.DataTable(p.Results.tableSelection,:).scientaEkin_eV{ii}',...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}(:,ij),'Color',tmp_color(ij,:));
|
|
hplot.LineWidth = lw;
|
|
hold on
|
|
end
|
|
xlabel('Electron kinetic energy [eV]')
|
|
elseif contains(p.Results.energyScale,'binding')
|
|
for ij = 1:p.Results.plotStep:size(p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii},2)
|
|
hplot = plot(p.Results.DataTable(p.Results.tableSelection,:).bindingEnergy_eV{ii}',...
|
|
p.Results.DataTable(p.Results.tableSelection,:).(p.Results.tableVariable){ii}(:,ij),'Color',tmp_color(ii,:));
|
|
hplot.LineWidth = lw;
|
|
end
|
|
hXLabel = xlabel('Binding energy [eV]');
|
|
end
|
|
if contains(p.Results.tableVariable,'Norm')
|
|
hYLabel = ylabel('Counts [arb. unit]');
|
|
else
|
|
hYLabel = ylabel('Counts per second');
|
|
end
|
|
|
|
|
|
box(gca,'on');
|
|
if ~matches(p.Results.figureMode,'word')
|
|
title([{p.Results.DataTable(p.Results.tableSelection,:).name{ii} p.Results.DataTable(p.Results.tableSelection,:).sample{ii} p.Results.DataTable(p.Results.tableSelection,:).lastModifiedDatestr{ii}}] ,'Interpreter','none')
|
|
end
|
|
set( gca, ...
|
|
'FontName' , fnt,'FontSize' , fsz );
|
|
set([hXLabel, hYLabel], ...
|
|
'FontName' , fnt);
|
|
set([hXLabel, hYLabel] , ...
|
|
'FontSize' , 1.2*fsz );
|
|
|
|
set(gca, ...
|
|
'Box' , 'off' , ...
|
|
'TickDir' , 'out' , ...
|
|
'TickLength' , [.02 .02] , ...
|
|
'XMinorTick' , 'on' , ...
|
|
'YMinorTick' , 'off' , ...
|
|
'XGrid' , 'on' , ...
|
|
'XColor' , [0 0 0], ...
|
|
'YColor' , [0 0 0], ...
|
|
'LineWidth' , alw );
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|