A handy tool to visualize Gaussian beam propagation through lenses
Here I present a handy tool written in Python to visualize how Gaussain beams propagate through two simple lenses. It provides a friendly environment to graphically see how beam property changes as we tune the beam intial beam size, lens focus and position. I utilize the widgets embedded in Matpyplot to create a dynamical user interface. It gives a graphical and intuitive sense when setting up the optics.
Packages needed: numpy matpylot
How to use: dowload the code GaussianVI.py, and type: python GaussianVI.py on the command line.
For Theory regarding Gaussian Optics, please see the following link: http://nic.ucsf.edu/blog/wp-content/uploads/2014/06/Gaussian-Beam-Optics.pdf
Todo list:
- Include beam property parameter M^2
- Add more lenses
- Fix the plotting issue when the second lens to set before the first lens.
Note for users:
- Please make sure the second lens is always set before the first lens and the the beam waist of the first images. I will try to fix this issue in the future.
- My intuition tells me this code can be done more elegantly and simply, excuse me for the code being too complex, will try to improve.
- The x = 0 position is the beam waist