A little while ago (while avoiding my thesis), I wrote a small R package for the calculation of the optical response of multilayer thin films. It’s called mlfilms
and is avaliable on github.
As a quick example, here is how you’d calculate and plot the reflection from a thin silver film through a prism. This is a standard experiment in our lab which results in a reflectivity minima associated with a surface plasmon excitation.
Firstly, load up the package.
library(mlfilms)
I’ll also load up ggplot
and photonMonkey
for plotting.
library(ggplot2)
library(photonMonkey)
Then we simply construct a stack with an appropriate refractive index and thickness (45 nm), and calculate the reflection (the default covers an angle between 0 and 90 degrees), with incident medium set to glass.
layers<-list(index=c(0.13+4i),thickness=c(45e-9),repetitions= 1)
R_plasmon<-angle_scan(incident_medium.index=1.5+0i,exit_medium.index=1+0i,layers=layers)
Plotting the result using ggplot
shows a critical edge related to the onset of total internal reflection in the prism, and the reflectivity minima resulting from a surface plasmon excitation on the silver/air interface.
qplot(R_plasmon$angle*180/pi,R_plasmon$Reflection,geom="line")+
theme_bw()+
scale_x_continuous(expand=c(0,0))+
xlab(label_polar_angle())+
ylab("reflection")
This package uses the transfer matrix method for this calculation, as outlined in Pedrotti, Pedrotti and Pedrotti. Currently it only does reflection, not trasnmission.