opticspy / lightpipes

LightPipes for Python, "Pure Python version"
https://opticspy.github.io/lightpipes/
BSD 3-Clause "New" or "Revised" License
227 stars 52 forks source link

Michelson interferometer with the Zernike aberration #76

Open bcbaz opened 1 year ago

bcbaz commented 1 year ago

Dear Professor Van Goor,

I want to reproduce the Michelson interferometer with the Zernike aberration in one of the arms. This one exactly: https://opticspy.github.io/lightpipes/_images/MichelsonWithAberration.png

Do you have the source code of this example? If not, I think I need do add this function: F1=Zernike(F1, n, m, R, A=1.0, norm=True, units='opd’) Correct? If so, what are the parameters to reproduce this image? I tried many combinations but couldn’t get something similar.

Thanks

FredvanGoor commented 1 year ago

Hi bzbaz, You have to choose a correct aberration to reproduce the figure. It is vertical coma, the aberration is some wavelengths. The code below will reproduce the figure closely. (Sorry, I forgot the exact parameters for the figure...)

Fred van Goor.

#! /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=7*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*mrad; ty=0.0*mrad # tilt of mirror 1

#Generate a weak converging laser beam using a weak positive lens:
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=Zernike(F2, 3, -1, 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)

plt.imshow(I,cmap='jet'); plt.axis('off');plt.title('intensity pattern')
plt.show()
FredvanGoor commented 1 year ago

I forgot to mention that you should also change one of the lengths (z1 or z2) of an arm with some fraction of a wavelength to fine-tune the result...

bcbaz commented 1 year ago

Thanks a lot. This works for me. I want to use the result in an art project. Hope this is OK for you.

FredvanGoor commented 1 year ago

Yes of course you can use it! I love art!Verstuurd vanaf mijn iPadOp 16 aug. 2023 om 08:25 heeft bcbaz @.***> het volgende geschreven: Thanks a lot. This works for me. I want to use the result in an art project. Hope this is OK for you.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: @.***>