summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 22:57:48 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 22:57:48 -0400
commit26af4be18380ae52b7628bd1aafa562b86f86fa4 (patch)
tree8df0ea5c0cb1dd1cb37a5be4f025ec0377cacd9c
parent0f6c67e982e06b9e8125ee082c9d86dce35ff183 (diff)
downloadbeam_profiler-26af4be18380ae52b7628bd1aafa562b86f86fa4.tar.gz
beam_profiler-26af4be18380ae52b7628bd1aafa562b86f86fa4.zip
Gaussian2D.m cleaned up
-rw-r--r--Gaussian2D.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/Gaussian2D.m b/Gaussian2D.m
index 7063b06..db111b1 100644
--- a/Gaussian2D.m
+++ b/Gaussian2D.m
@@ -7,10 +7,12 @@ cy = p(2);
wx = p(3);
wy = p(4);
amp = p(5); % beam amplitude or peak intensity
-theta = p(6); % if beam is ellipticle then it is major axis angle
+theta = p(6); % if beam is elliptical then it is major axis angle
background=p(7);
+% rotate squished beam appropriately
Xn = (X-cx)*cos(theta) - (Y-cy)*sin(theta);
Yn = (X-cx)*sin(theta) + (Y-cy)*cos(theta);
-z = amp*(exp(-2*((Xn).^2./(wx^2)+(Yn).^2./(wy^2)))) + background;
+% finally we calculate Gaussian profile
+z = amp*exp(-2*((Xn/wx).^2+(Yn/wy).^2)) + background;