This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-param slit? true) ; set to false to turn off the slit | |
(define a 1e-6) ;length unit used in simulation = 1 micron | |
(set! resolution 50) ;pixels per micron | |
(define size-x 7) ;microns | |
(define size-y 3) ;microns | |
(define wl 0.83) ;microns | |
(define pi 3.14159265358979) | |
(define c0 299792458) ; m/s | |
(define timesteps 150) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as N | |
import numpy.fft | |
from matplotlib import pyplot as P | |
npoints = 51 # odd number | |
side = N.linspace(-1, 1, npoints) | |
x, y = N.meshgrid(side, side) | |
r, theta = N.hypot(x, y), N.arctan2(y, x) | |
# Create a gaussian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as N | |
import matplotlib.colors | |
def rotate(x, y, angle): | |
r, theta = N.sqrt(x ** 2 + y ** 2), N.arctan2(y, x) | |
theta += angle | |
return r * (N.cos(theta), N.sin(theta)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugindir = $(libdir)/plugins | |
dist_plugin_DATA = confplugin.plugin | |
plugin_LTLIBRARIES = libconfplugin.la | |
libconfplugin_la_SOURCES = confplugin.c | |
libconfplugin_la_LIBADD = $(PLUGIN_LIBS) | |
libconfplugin_la_LDFLAGS = -module -avoid-version -shared | |
AM_CFLAGS = $(PLUGIN_CFLAGS) | |
dist_noinst_SCRIPTS = testconfplugin.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import warnings | |
import numpy as N | |
import numpy.fft as FT | |
from scipy import integrate | |
from spp_generation import interface_calculation | |
class SlitSystem: | |
"""Simulation of a subwavelength slit in metal""" | |
def __init__(self, slit_widths, wavelength, metal_epsilon, metal_thickness, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as N | |
from scipy import constants as Const | |
from crystal_plane import CrystalPlane | |
""" | |
Parallel-band conductivity (Ashcroft & Sturm, 1971) using measured data and | |
fits (Mathewson & Myers, 1972) | |
""" | |
# sigma_a: Ashcroft & Sturm's "convenient" unit of conductivity | |
sigma_a = Const.e ** 2 / (24 * N.pi * Const.value('Bohr radius') * Const.hbar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Gtk = imports.gi.Gtk; | |
Gtk.init(null); | |
let w = new Gtk.Window(); | |
let b = new Gtk.Button({ label: "Click me for an exception" }); | |
w.add(b); | |
b.connect('clicked', function() { | |
throw("This exception is not caught, only printed"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Gtk = imports.gi.Gtk; | |
Gtk.init(null); | |
let w = new Gtk.Window({ | |
default_width: 800, | |
default_height: 600 | |
}); | |
let g = new Gtk.Grid(); | |
let frame = new Gtk.Frame({ expand: true }); | |
let label = new Gtk.Label({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GLib = imports.gi.GLib; | |
const Lang = imports.lang; | |
const System = imports.system; | |
let _breakpoints = 0; | |
function _getCurrentStack() { | |
try { | |
throw new Error(); | |
} catch (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Process this file with automake to produce Makefile.in | |
ACLOCAL_AMFLAGS = -I m4 | |
AM_CPPFLAGS = $(FOO_CFLAGS) | |
lib_LTLIBRARIES = libfoo.la | |
libfoo_la_SOURCES = foobar.c foobar.h | |
libfoo_la_LIBADD = $(FOO_LIBS) | |
libfoo_la_LDFLAGS = -export-symbols-regex "^foo_" |
OlderNewer