summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 23:14:12 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 23:14:12 -0400
commit45b8ad5eace6dc5fff2e0b445cb5abd3c6b94cb1 (patch)
tree6a9eb5446783a15551497d42ed7676734e064070
parent26af4be18380ae52b7628bd1aafa562b86f86fa4 (diff)
downloadbeam_profiler-45b8ad5eace6dc5fff2e0b445cb5abd3c6b94cb1.tar.gz
beam_profiler-45b8ad5eace6dc5fff2e0b445cb5abd3c6b94cb1.zip
fitgaussian2D.m simplified
-rw-r--r--fitgaussian2D.m9
1 files changed, 2 insertions, 7 deletions
diff --git a/fitgaussian2D.m b/fitgaussian2D.m
index 7cf52b9..a852b56 100644
--- a/fitgaussian2D.m
+++ b/fitgaussian2D.m
@@ -76,15 +76,10 @@ options.Display = 'iter';
options.TolFun = tol;
initpar = [cx,cy,sx,sy,PeakOD,theta,background];
%this is to avoid errors when doing fits on the image full of zeros
-if isnan(sum(sum(Gaussian2Dff(initpar,X,Y,m)))) < 1
+if isnan(sum(sum(Gaussian2D(initpar,X,Y)-m))) < 1
% Here is the actual fit
- fp = lsqnonlin( @(pt) Gaussian2Dff(pt,X,Y,m),initpar,LB,UB,options);
+ fp = lsqnonlin( @(pt) Gaussian2D(pt,X,Y)-m,initpar,LB,UB,options);
else
fp = [0,0,0,0,0,0,0];
end;
-
-
-% 2D Gauss function
-function [z] = Gaussian2Dff(p,X,Y,m);
-z = Gaussian2D(p,X,Y) - m;