Programs
Here some programs I have made that may be useful for other researchers/students are kept. These are as error free as possible, but let me know if you find anything. Everything is written in Python, except where noted.
PyOpticalTable: Drawing Optical Layouts In Matplotlib
Having spent many hours drawing optical layouts in matplotlib by drawing lines and boxes using plt.plot(), I decided I should write a library for making it easier. In retrospect, I don't foresee having to draw another optical layout for a while, but I hope that PyOpticalTable can be useful for someone else sometime. It's reasonably well documented on there, and there's a github link on the page linked above. Just download it and use the file as a python module. The nice thing about it is that it lets you resize the figure/table without ruining all the aspect ratios - and if you want to tweak the position of an optic 5 minutes before your thesis deadline, then it will automatically reroute the laser beam for you. It's not a ray tracing program though, just pretty figures.
TeX Stripper
The TeX stripper is a Rust program that strips environments from a source TeX document and puts them in a new document. I use it to create beamer presentations from my lecture notes, that just contain all the figures, boxes, and tables from the main notes. It basically extracts all these, puts them in a file with some boilerplate TeX at the start, end, and around each stripped environment. This program is basically the opposite of the kind of program you'd normally use Rust for, but I was looking for a reason to try it out. It needs to run on an already expanded source file (i.e. no \include{}
statements). The Perl program latexpand
is good for this if needed.
SFGTools Software Package
SFGTools is a Python package I wrote for procesing data from Sum-Frequency Generation (SFG) spectroscopy experiments. Mostly it was written in conjunction with a series of tutorial articles I wrote, and was a bit of a labour of love (my Python improved dramatically through doing this). There's a package that can be used in a normal Python script, and also a GUI for easy processing of lots of data by people less comfortable with Python. This is being actively updated (and various bugs fixed), so please contact me if there are additions that would be nice (using this framework to extend to other kinds of spectroscopy data would also be interesting).
SFG Upconversion Simulator
The SFG upconversion simulator is designed to allow you to generate the spectral line that a user-given molecular resonance will produce in an sum-frequency generation (SFG) spectroscopy measurement, with a given IR and VIS (upconversion) pulse. Specifically, the aim is to allow the effect of the delay between IR and VIS, and the effect of the VIS pulse shape/width/length on the output spectrum to be seen. The program is pretty thoroughly commented and is quite straightforward to use, it will output an illustration of your input electric fields, and also the "ideal" spectral line (with perfect upconversion), together with the "actual" spectral line that your given upconverter will create. It does not account for realistic amplitudes and so cannot simulate an actual spectrum quantitatively, but illustrates the effects on spectral linewidth well. I would treat the results as semi-quantitative, as there are many factors aside from the VIS pulse that contribute to spectral linewidth (it doesn't, for example, account for if you've focussed into your spectrograph badly). I think it is most useful as a teaching/pedagogical tool for people new to the field to mess around with.
SFG Local Field Factors
This Python script calculates and plots the local field correction factors used in SFG spectroscopy. Possibly wins the award of 'most basic program ever to deserve a git repo', but there we are.
Knife-edge beam profiler fitting
This program allows you to calculate the size of a laser beam simply by measuring the beam power on a power meter, and then scanning a razor blade (or other sharp object) through the face of the beam. Recording the transmitted power as a function of the razor blade position can then be fitted to a function that allows the beam radius (1/e^2) to be calculated. A PDF explaining how I derived the equation to fit to is here, for reference. The program is pretty self-explanatory and simple, but assumes that you are measuring the stage position in millimetres. It was intended initially for measuring on unfocussed beams, but could also be used with a focussed beam provided that you don't burn the knife edge. Commented out in the program is some example data I took from one of the laser systems in my lab.