-
Notifications
You must be signed in to change notification settings - Fork 4
basic
baptiste edited this page Nov 26, 2013
·
6 revisions
In this example we define a dimer of nanorods, model its optical response to linearly polarised light at fixed incidence, and orientation-averaged optical activity.
library(cda)
library(rgl)
library(ggplot2)
library(reshape2)
library(plyr)
# dielectric function
wvl <- seq(400, 900)
gold <- epsAu(wvl)
# define a cluster of particles
cl <- list(r = rbind(c(0, 0, 0),
c(0, 0, -100)),
angles = rbind(c(0, 0, 0),
c(pi/4, 0, 0)),
sizes = rbind(c(30, 10, 10),
c(30, 10, 10)))
# visualise
rgl.ellipsoids(cl$r, cl$sizes, cl$angles, col="gold")
rgl.viewpoint( theta = 0, phi = 20, fov = 70, zoom = 1)
# calculate extinction spectrum at fixed incidence
linear <- dispersion_spectrum(cl, gold)
ggplot(linear, aes(wavelength, value, linetype=type)) +
facet_wrap(~polarisation) + geom_path()
circular <- circular_dichroism_spectrum(cl, gold)
ggplot(circular, aes(wavelength, value, color=variable)) +
facet_grid(type~., scales="free") + geom_line()