summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 22:44:12 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2012-09-19 22:44:12 -0400
commit6b517b574ddec6051bc5c5b162e8370bd25ce481 (patch)
tree2f6223db22fb371fdd350c66e4292fb7107a3f81
parent4da9a282fd421dba8f10ccec4c3246983cb743cf (diff)
downloadbeam_profiler-6b517b574ddec6051bc5c5b162e8370bd25ce481.tar.gz
beam_profiler-6b517b574ddec6051bc5c5b162e8370bd25ce481.zip
comments added for Gaussian2D.m
-rw-r--r--Gaussian2D.m13
1 files changed, 7 insertions, 6 deletions
diff --git a/Gaussian2D.m b/Gaussian2D.m
index 586ea36..7063b06 100644
--- a/Gaussian2D.m
+++ b/Gaussian2D.m
@@ -1,15 +1,16 @@
function [z] = Gaussian2D(p,X,Y);
+% beam position (center of Gaussian)
cx = p(1);
-cy = p(2);
+cy = p(2);
+% waiste size 1/e in amplitude, 1/e^2 in intensity
wx = p(3);
wy = p(4);
-amp = p(5);
-theta = p(6);
-background=p(7);
+amp = p(5); % beam amplitude or peak intensity
+theta = p(6); % if beam is ellipticle then it is major axis angle
+background=p(7);
+
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)-2*(Yn).^2./(wy^2))) + background;
-
z = amp*(exp(-2*((Xn).^2./(wx^2)+(Yn).^2./(wy^2)))) + background;