Skip to content

Commit

Permalink
changed Michelson example
Browse files Browse the repository at this point in the history
  • Loading branch information
FredvanGoor committed Aug 6, 2024
1 parent bf681a7 commit 34e2254
Show file tree
Hide file tree
Showing 221 changed files with 1,124 additions and 150 deletions.
4 changes: 2 additions & 2 deletions docs/DiffractionRoundHole.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>7.2.1. Diffraction from a circular aperture. &mdash; LightPipes for Python 2.1.5 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css?v=7f9a90b1" />


<!--[if lt IE 9]>
Expand Down Expand Up @@ -127,7 +127,7 @@

<div role="contentinfo">
<p>&#169; Copyright 2017, Fred van Goor.
<span class="lastupdated">Last updated on Aug 05, 2024.
<span class="lastupdated">Last updated on Aug 06, 2024.
</span></p>
</div>

Expand Down
4 changes: 2 additions & 2 deletions docs/GRINYoung.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>7.8.2. Young’s experiment with GRIN lens. &mdash; LightPipes for Python 2.1.5 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css?v=7f9a90b1" />


<!--[if lt IE 9]>
Expand Down Expand Up @@ -125,7 +125,7 @@

<div role="contentinfo">
<p>&#169; Copyright 2017, Fred van Goor.
<span class="lastupdated">Last updated on Aug 05, 2024.
<span class="lastupdated">Last updated on Aug 06, 2024.
</span></p>
</div>

Expand Down
4 changes: 2 additions & 2 deletions docs/HermiteGaussModes.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>7.5.1. Hermite Gauss modes. &mdash; LightPipes for Python 2.1.5 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css?v=7f9a90b1" />


<!--[if lt IE 9]>
Expand Down Expand Up @@ -130,7 +130,7 @@

<div role="contentinfo">
<p>&#169; Copyright 2017, Fred van Goor.
<span class="lastupdated">Last updated on Aug 05, 2024.
<span class="lastupdated">Last updated on Aug 06, 2024.
</span></p>
</div>

Expand Down
231 changes: 219 additions & 12 deletions docs/MichelsonInterferometer.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/RadialShearInterferometer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>7.7.2. Radial shear interferometer. &mdash; LightPipes for Python 2.1.5 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css?v=7f9a90b1" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />


<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion docs/YoungsExperiment.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@

<div role="contentinfo">
<p>&#169; Copyright 2017, Fred van Goor.
<span class="lastupdated">Last updated on Aug 05, 2024.
<span class="lastupdated">Last updated on Aug 06, 2024.
</span></p>
</div>

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_downloads/05cf9e88fd778efed44b463299901cb1/FocLens.pdf
Binary file not shown.
Binary file modified docs/_downloads/089d13c0fc4dc38e28bae9da6de92712/Forvard6.pdf
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/0de26861a016bc75fafe56c12d52dcac/ZonePlate.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/16828266d130f658022f9045b3223280/D4sigma.pdf
Binary file not shown.
Binary file modified docs/_downloads/1822297a86a45668cab7fb47e85db116/Tilt.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/1ad6c474227b82b1f25696f31ab7cf4e/Poisson.pdf
Binary file not shown.
Binary file modified docs/_downloads/1ba3e5c2aaabaa54774559af55d494cc/Forvard4.pdf
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/2b445da2c111c3ac3bbd8f7a23acb38a/MultiHole.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/46f8bfe8dac94f78ef9baaa20f2db0da/AiryBeam2D.pdf
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/47da3727a7044f58c76329de3d2c1472/AiryBeam1D.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/4a71de1ab14450463ea4a7d2e8dec87b/Young.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/4caabc921cb8c0f4988d241fdecd1d66/GRIN_Young.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/_downloads/653f7b9fb2ad9318a8265875eb112270/Forvard2.pdf
Binary file not shown.
Binary file modified docs/_downloads/6c697f6b614bbc0af33d23013d0526c1/rad_shear.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#! /usr/bin/env python
from LightPipes import *
import matplotlib.pyplot as plt

wavelength=632.8*nm #wavelength of HeNe laser
size=15*mm # size of the grid
N=500 # number (NxN) of grid pixels
R=9*mm # laser beam radius
z1=8*cm # length of arm 1
z2=7*cm # length of arm 2
z3=3*cm # distance laser to beamsplitter
z4=5*cm # distance beamsplitter to screen
Rbs=0.5 # reflection beam splitter
tx=0.0*mrad; ty=0.0*mrad # tilt of mirror 1
f_lens = 500*cm

#Generate a laser beam:
F=Begin(size,wavelength,N)
F=GaussBeam(F, R)

#Propagate to the beamsplitter:
F=Forvard(z3,F)

#Split the beam and propagate to mirror #2:
F2=IntAttenuator(1-Rbs,F)
F2=Forvard(z2,F2)

#Introduce aberration and propagate back to the beamsplitter:
F2=Tilt(tx,ty,F2)
F2 = Lens(f_lens, F2)
F2=Forvard(z2,F2)
F2=IntAttenuator(Rbs,F2)

#Split off the second beam and propagate to- and back from the mirror #1:
F10=IntAttenuator(Rbs,F)
F1=Forvard(z1*2,F10)
F1=IntAttenuator(1-Rbs,F1)

#Recombine the two beams and propagate to the screen:
F=BeamMix(F1,F2)
F=Forvard(z4,F)
I=Intensity(1,F)

s1 = r'LightPipes for Python ' + LPversion + '\n\n'\
r'Michelson interferometer with a lens in one arm' + '\n'
s2 = r'Michelson.py'+ '\n\n'\
f'size = {size/mm:4.2f} mm' + '\n'\
f'$\\lambda$ = {wavelength/um:4.2f} $\\mu$m' + '\n'\
f'N = {N:d}' + '\n'\
f'R = {R/mm:4.2f} mm beam radius of the laser' + '\n'\
f'z1 = {z1/mm:4.2f} mm length of arm 1' + '\n'\
f'z2 = {z2/mm:4.2f} mm length of arm 2' + '\n'\
f'z3 = {z3/mm:4.2f} mm distance from the laser to the beam splitter' + '\n'\
f'z4 = {z4/mm:4.2f} mm distance from the beam splitter to the screen' + '\n'\
f'tx, ty = {tx/mrad:4.2f}, {ty/mrad:4.2f} mrad tilt of mirror 2' + '\n'\
r'$f_{lens}$ = ' + f'{f_lens/cm:4.2f} cm focal length of the lens in arm 2' + '\n\n'\
r'${\copyright}$ Fred van Goor, June 2020'

fig=plt.figure(figsize=(6,9));
ax1 = fig.add_subplot(311);ax1.axis('off')
ax2 = fig.add_subplot(312);ax2.axis('off')
ax3 = fig.add_subplot(313);ax3.axis('off')
ax1.imshow(I,cmap='jet');ax1.set_title('intensity pattern')
ax2.text(0.0,0.6,s1,fontsize=12, fontweight='bold')
ax3.text(0.0,0.50,s2)

plt.show()
Binary file not shown.
Binary file modified docs/_downloads/78d27bb8d8b76fd583592635a89fd6ad/Michelson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/_downloads/7e74f8c5c0a93e440c02a259a069b0ca/Forvard5.pdf
Binary file not shown.
Binary file modified docs/_downloads/86c0be24940d8b3b57fee354ab37e21d/Strehl.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
58 changes: 25 additions & 33 deletions docs/_downloads/8e82c777750716932345579b66e0387e/Michelson.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,37 @@
z3=3*cm # distance laser to beamsplitter
z4=5*cm # distance beamsplitter to screen
Rbs=0.5 # reflection beam splitter
tx=0.0*mrad; ty=0.0*mrad # tilt of mirror 1
zernabb = 7 # Zernike aberration (7 = vertical coma)
tx=0.5*mrad; ty=0.0*mrad # tilt of mirror 1

print(ZernikeName(zernabb))
print(noll_to_zern(zernabb))

#Generate a weak diverging laser beam using a weak negative lens:
#Generate a laser beam:
F=Begin(size,wavelength,N)
F=GaussBeam(F, R)
#F=Lens(F,-0.5*m)

#Propagate to the beamsplitter:
F=Forvard(z3,F)
F=Forvard(F,z3)

#Split the beam and propagate to mirror #2:
F2=IntAttenuator(1-Rbs,F)
F2=Forvard(z2,F2)
F2=IntAttenuator(F, 1-Rbs)
F2=Forvard(F2,z2)

#Introduce aberration and propagate back to the beamsplitter:
F2=Tilt(tx,ty,F2)
(mz, nz) = noll_to_zern(zernabb)
F2=Zernike(F2, mz, nz, 6*mm, A=1.03*wavelength)
F2=Forvard(z2,F2)
F2=IntAttenuator(Rbs,F2)
F2=Tilt(F2,tx,ty)
F2=Forvard(F2,z2)
F2=IntAttenuator(F2,Rbs)

#Split off the second beam and propagate to- and back from the mirror #1:
F10=IntAttenuator(Rbs,F)
F1=Forvard(z1*2,F10)
F1=IntAttenuator(1-Rbs,F1)
F10=IntAttenuator(F,Rbs)
F1=Forvard(F10,z1*2)
F1=IntAttenuator(F1,1-Rbs)

#Recombine the two beams and propagate to the screen:
F=BeamMix(F1,F2)
F=Forvard(z4,F)
I=Intensity(1,F)
F=Forvard(F,z4)
I=Intensity(F)

s1 = r'LightPipes for Python ' + LPversion + '\n'
#Present the results:
s1 = r'LightPipes for Python ' + LPversion + '\n\n'\
r'Michelson interferometer with mirror tilt in one arm' + '\n'
s2 = r'Michelson.py'+ '\n\n'\
f'size = {size/mm:4.2f} mm' + '\n'\
f'$\\lambda$ = {wavelength/um:4.2f} $\\mu$m' + '\n'\
Expand All @@ -55,19 +51,15 @@
f'z2 = {z2/mm:4.2f} mm length of arm 2' + '\n'\
f'z3 = {z3/mm:4.2f} mm distance from the laser to the beam splitter' + '\n'\
f'z4 = {z4/mm:4.2f} mm distance from the beam splitter to the screen' + '\n'\
f'tx, ty = {tx/mrad:4.2f}, {ty/mrad:4.2f} mrad tilt of mirror 2' + '\n'\
f'Zernike aberration = {noll_to_zern(zernabb)}, {ZernikeName(zernabb)}' + '\n'\
f'tx, ty = {tx/mrad:4.2f}, {ty/mrad:4.2f} mrad tilt of mirror 2' + '\n\n'\
r'${\copyright}$ Fred van Goor, June 2020'

fig=plt.figure(figsize=(12,12));
fig=plt.figure(figsize=(6,9));
ax1 = fig.add_subplot(311);ax1.axis('off')
ax2 = fig.add_subplot(312);ax2.axis('off')
ax3 = fig.add_subplot(313);ax3.axis('off')
ax1.imshow(I,cmap='jet');ax1.set_title('intensity pattern')
ax2.text(0.0,0.6,s1,fontsize=12, fontweight='bold')
ax3.text(0.0,0.50,s2)

ax2 = fig.add_subplot(312);ax2.axis('on')
ax3 = fig.add_subplot(313);ax3.axis('on')
ax1.imshow(I,cmap='rainbow');ax1.set_title('intensity pattern')


ax2.text(0.0,1.0,s1,fontsize=12, fontweight='bold')
ax3.text(0.0,0.5,s2)
#plt.imshow(I,cmap='jet'); plt.axis('off');plt.title('intensity pattern')
plt.show()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_downloads/a495bb86f9ae7d0816eb946056fe7bba/RoundHole.pdf
Binary file not shown.
Binary file modified docs/_downloads/a5f13f739b04af91ee03a6fca2f496fc/Zernike.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#! /usr/bin/env python
from LightPipes import *
import matplotlib.pyplot as plt

wavelength=632.8*nm #wavelength of HeNe laser
size=15*mm # size of the grid
N=500 # number (NxN) of grid pixels
R=9*mm # laser beam radius
z1=8*cm # length of arm 1
z2=7*cm # length of arm 2
z3=3*cm # distance laser to beamsplitter
z4=5*cm # distance beamsplitter to screen
Rbs=0.5 # reflection beam splitter
tx=0.0*mrad; ty=0.0*mrad # tilt of mirror 1
zernabb = 7 # Zernike aberration (7 = vertical coma)



#Generate a laser beam:
F=Begin(size,wavelength,N)
F=GaussBeam(F, R)

#Propagate to the beamsplitter:
F=Forvard(z3,F)

#Split the beam and propagate to mirror #2:
F2=IntAttenuator(1-Rbs,F)
F2=Forvard(z2,F2)

#Introduce aberration and propagate back to the beamsplitter:
F2=Tilt(tx,ty,F2)
(mz, nz) = noll_to_zern(zernabb)
F2=Zernike(F2, mz, nz, 6*mm, A=1.03*wavelength)
F2=Forvard(z2,F2)
F2=IntAttenuator(Rbs,F2)

#Split off the second beam and propagate to- and back from the mirror #1:
F10=IntAttenuator(Rbs,F)
F1=Forvard(z1*2,F10)
F1=IntAttenuator(1-Rbs,F1)

#Recombine the two beams and propagate to the screen:
F=BeamMix(F1,F2)
F=Forvard(z4,F)
I=Intensity(1,F)

s1 = r'LightPipes for Python ' + LPversion + '\n\n'\
r'Michelson interferometer with Zernike'+ '\n' + 'aberration in one arm' + '\n'

s2 = r'Michelson-with-aberration.py'+ '\n\n'\
f'size = {size/mm:4.2f} mm' + '\n'\
f'$\\lambda$ = {wavelength/um:4.2f} $\\mu$m' + '\n'\
f'N = {N:d}' + '\n'\
f'R = {R/mm:4.2f} mm beam radius of the laser' + '\n'\
f'z1 = {z1/mm:4.2f} mm length of arm 1' + '\n'\
f'z2 = {z2/mm:4.2f} mm length of arm 2' + '\n'\
f'z3 = {z3/mm:4.2f} mm distance from the laser to the beam splitter' + '\n'\
f'z4 = {z4/mm:4.2f} mm distance from the beam splitter to the screen' + '\n'\
f'tx, ty = {tx/mrad:4.2f}, {ty/mrad:4.2f} mrad tilt of mirror 2' + '\n'\
f'Zernike aberration = {noll_to_zern(zernabb)}, {ZernikeName(zernabb)}' + '\n\n'\
r'${\copyright}$ Fred van Goor, June 2020'

fig=plt.figure(figsize=(6,9));
ax1 = fig.add_subplot(311);ax1.axis('off')
ax2 = fig.add_subplot(312);ax2.axis('off')
ax3 = fig.add_subplot(313);ax3.axis('off')
ax1.imshow(I,cmap='jet');ax1.set_title('intensity pattern')
ax2.text(0.0,0.6,s1,fontsize=12, fontweight='bold')
ax3.text(0.0,0.50,s2)

plt.show()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/_downloads/b8c313d9c0dafd32f19df75088ec126a/GRIN_demo.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/c6573bceb64e991138e0edcb6e5e20d2/Lens.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/cce4467a5db0d88808554acc48f4317e/MultiSlit.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_downloads/dd89fe73fb43d0cad5f9bba697b3a501/Begin.pdf
Binary file not shown.
Binary file modified docs/_downloads/df553e836f2ba9a4690fca5b76ebe132/Forvard3.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/_downloads/f76b12977b6dab234fc52890bf4e444b/Forvard.pdf
Binary file not shown.
Binary file modified docs/_downloads/f8daa5593084cda3841a810c1fc3dc61/PipFFT.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added docs/_images/Michelson-with-aberration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/Michelson-with-lens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/Michelson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_images/MichelsonWithAberration.png
Binary file not shown.
Binary file removed docs/_images/MichelsonWithLens.png
Binary file not shown.
Binary file modified docs/_images/unstable_resonator_00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/unstable_resonator_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/unstable_resonator_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/unstable_resonator_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 34e2254

Please sign in to comment.