...
 
Commits (7)
......@@ -316,6 +316,9 @@ end
function mouse_down(hObject,eventdata)
handles = guidata( ancestor(hObject, 'figure') );
if handles.running
return
end
cursorPoint = get(handles.axSpectrum, 'CurrentPoint');
curX = cursorPoint(1,1);
curY = cursorPoint(1,2);
......@@ -337,6 +340,10 @@ guidata(hObject,handles);
function mouse_mov(hObject,eventdata)
handles = guidata( ancestor(hObject, 'figure') );
if handles.running
return
end
if handles.mDown
cursorPoint = get(handles.axSpectrum, 'CurrentPoint');
curX = cursorPoint(1,1);
......@@ -386,6 +393,10 @@ end
function mouse_up(hObject,eventdata)
handles = guidata( ancestor(hObject, 'figure') );
if handles.running
return
end
handles.mDown = false;
if ~handles.running && size(handles.xrange,2) > 2 && size(handles.yrange,2) > 2 && size(get(handles.lbT2, 'value'),2) > 2
......@@ -450,15 +461,15 @@ end
err = false;
warning('off','all')
%try
try
plotdata = lsa_performFit(selMethod,handles.data_fit_full,delayrange,handles.xrange,handles.yrange,handles.probe_axis,handles.pump_axis,handles.actual_delays,get(handles.ddExp, 'value'),weighted,get(handles.cbCenter,'Value'),[logFit,logParts]);
%catch e
% fprintf(2,'The identifier was:\n%s\n',e.identifier);
% fprintf(2,'There was an error! The message was:\n%s\n',e.message);
% plotdata = [];
% errordlg('Something went wrong with the fit!','Fit error!','modal');
% err = true;
%end
catch e
fprintf(2,'The identifier was:\n%s\n',e.identifier);
fprintf(2,'There was an error! The message was:\n%s\n',e.message);
plotdata = [];
errordlg('Something went wrong with the fit!','Fit error!','modal');
err = true;
end
warning('on','all')
if logFit ~= -1
......
......@@ -327,6 +327,10 @@ function [plotdata] = lsa_performFit(type,spectra,delayrange,xrange,yrange,probe
corrs = zeros(length,1);
errs = zeros(length,1);
wgt = zeros(length,1);
peak_volumes.fit = zeros(length,1);
peak_volumes.real = zeros(length,1);
peak_extrema.fit = zeros(length,1);
peak_extrema.real = zeros(length,1);
for delay = 1:length
spec = reshape(spectra(delayrange(delay),:,:),[sizex,sizey])';
......@@ -362,6 +366,18 @@ function [plotdata] = lsa_performFit(type,spectra,delayrange,xrange,yrange,probe
plotdata.debugplots(delay).gauss = z;
plotdata.debugplots(delay).mdl = mdl;
if sgn > 0
peak_volumes.fit(delay) = sum(sum(z(yrange,xrange)));
peak_volumes.real(delay) = sum(sum(spec(yrange,xrange)));
peak_extrema.fit(delay) = max(max(z(yrange,xrange)));
peak_extrema.real(delay) = max(max(spec(yrange,xrange)));
else
peak_volumes.fit(delay) = -sum(sum(z(yrange,xrange)));
peak_volumes.real(delay) = -sum(sum(spec(yrange,xrange)));
peak_extrema.fit(delay) = min(min(z(yrange,xrange)));
peak_extrema.real(delay) = min(min(spec(yrange,xrange)));
end
%% Log: 2DG
if logFit
fprintf(logfids(1),"--------\n");
......@@ -374,6 +390,9 @@ function [plotdata] = lsa_performFit(type,spectra,delayrange,xrange,yrange,probe
end
end
plotdata.peak_volumes = peak_volumes;
plotdata.peak_extrema = peak_extrema;
case {'NLS', 'NLSbox'}
if type == "NLSbox"
constraint = false;
......@@ -400,7 +419,7 @@ function [plotdata] = lsa_performFit(type,spectra,delayrange,xrange,yrange,probe
corrs(delay) = mdl.Coefficients.Estimate(2);
errs(delay) = mdl.Coefficients.SE(2);
wgt(delay) = mdl.Rsquared.Ordinary;
amps = zeros(size(yrange,2),1);
centers = zeros(size(yrange,2),1);
for slice = 1:size(yrange,2)
......@@ -465,7 +484,8 @@ function [plotdata] = lsa_performFit(type,spectra,delayrange,xrange,yrange,probe
plotdata.delayrange = delayrange;
plotdata.spectra = spectra;
plotdata.weighted = weighted;
plotdata.sgn = sgnCent;
plotdata.sgnCent = sgnCent;
plotdata.sgn = sgn;
plotdata.type = type;
switch numExp
......
No preview for this file type
This diff is collapsed.