summaryrefslogtreecommitdiff
path: root/show_diffraction.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2014-05-16 16:09:53 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2014-05-16 16:09:53 -0400
commit5ae2b91ddda5583c8a24a28eb136ee08585a7125 (patch)
tree7a2eaeed3f2d246e0cc2c3feaa8a94c2f96be914 /show_diffraction.m
parent24b48105c1c4ed1dcd3a0de68df91d7003b2789c (diff)
downloadbeam_reshape-5ae2b91ddda5583c8a24a28eb136ee08585a7125.tar.gz
beam_reshape-5ae2b91ddda5583c8a24a28eb136ee08585a7125.zip
addition of exact diffraction calculation
Diffstat (limited to 'show_diffraction.m')
-rw-r--r--show_diffraction.m29
1 files changed, 29 insertions, 0 deletions
diff --git a/show_diffraction.m b/show_diffraction.m
new file mode 100644
index 0000000..3421b0f
--- /dev/null
+++ b/show_diffraction.m
@@ -0,0 +1,29 @@
+function show_diffraction(img_source, xpos_s, ypos_s, img_target, xpos_t, ypos_t)
+
+[Ny_s,Nx_s] = size(img_source);
+[Ny_t,Nx_t] = size(img_target);
+
+% plot mask image
+figure(1);
+x_s=linspace(xpos_s(1), xpos_s(end), Nx_s);
+y_s=linspace(ypos_s(1), ypos_s(end), Ny_s);
+imagesc(x_s,y_s, abs(img_source).^2);
+colorbar; colormap('gray');
+xlabel('x (m)');
+ylabel('y (m)');
+title('mask image');
+
+% plot diffraction image
+figure(2);
+x_t=linspace(xpos_t(1), xpos_t(end), Nx_t);
+y_t=linspace(ypos_t(1), ypos_t(end), Ny_t);
+% I use gamma correction due to luck of the display dynamic range
+% pixel brightness correction, display dependent
+%gamma=1/4;
+gamma=1;
+imagesc(x_t, y_t, (abs(img_target).^2).^(gamma));
+colorbar; colormap('gray');
+xlabel('x (m)');
+ylabel('y (m)');
+title('target image');
+