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
emotion :+1: :-1: :clap: :heart: :sparkles: :v: :zzz: | |
icon :new: :ok: :cool: :vs: :tm: :warning: :wheelchair: :zap: :art: :bomb: :bulb: :key: :lock: :memo: :mag: | |
item :book: :gift: :moneybag: :mega: :scissors: :hammer: | |
device :computer: :iphone: :calling: :email: | |
human :cop: :runner: :feet: :fist: :punch: :lipstick: :tophat: | |
food :beer: :cake: :smoking: | |
behicle :airplane: :bike: :bus: :ski: :taxi: :train: | |
animal :bear: :fish: :octocat: | |
nature :fire: :leaves: :star: :sunny: |
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
# Based on "Approximate Inversion of the Laplace Transform" by Cheng and Sidauruk, | |
# in the Mathematica Journal, vol 4, issue 2, 1994 | |
import scipy.misc | |
fact = scipy.misc.factorial | |
def csteh(n, i): | |
acc = 0.0 | |
for k in xrange(int(np.floor((i+1)/2.0)), int(min(i, n/2.0))+1): | |
num = k**(n/2.0) * fact(2 * k) |
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
#!/usr/bin/env python | |
# | |
# Makes a wav file out of owon oscilloscope waveform save file. | |
# Tested with SDS6062 only. | |
# | |
# Used: | |
# http://bikealive.nl/owon-bin-file-format.html and | |
# http://bikealive.nl/tl_files/EmbeddedSystems/Test_Measurement/owon/OWON%20Oscilloscope%20PC%20Guidance%20Manual.pdf | |
# |
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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
""" | |
Download and unpack the Hipparcos star catalog from www.astronexus.com/files/downloads/hygfull.csv.gz | |
Run in python to show interactive sky map with apparent star magnitude and approximate colour. | |
About 90000 stars are plotted within a second, you can pan and zoom the view. | |
Run with "--interactive no" to generate a big PDF file for printing. I could not find anything with this |
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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
# Supporting Python 3 | |
import sys, os, re | |
try: bibtexdb = open(sys.argv[1]).read() | |
except: print("Error: specify the file to be processed!") | |
if not os.path.isfile('journalList.txt'): |
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
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
import numpy as np | |
import scipy.constants as sc | |
import matplotlib.pyplot as plt | |
import matplotlib |
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
#!/usr/bin/python3 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import numpy.linalg as la | |
width, n= 1., 500 ## width of the 1D quantum system, and number of points | |
nplot = 10 ## number of quantum states to plot | |
h = 1e-4 ## our definition of "Planck constant" determines the density of states | |
psiscale = .01 ## for plotting only: approximate matching of probability and potential scales |
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
fw=int(len(xs[0])/30) # filter width | |
fl=int(len(xs[0])/20) # filter limit: minimum position of the Fabry-Pérot peak in correlation function | |
skippoints = 0 # sometimes the first point is some header | |
def nGaN(energies): | |
## returns index of refraction in GaN according to [Tisch et al., JAP 89 (2001)] | |
eV = [1.503, 1.655, 1.918, 2.300, 2.668, 2.757, 2.872, 3.006, 3.136, 3.229, 3.315, 3.395, 3.422] | |
n = [2.359+0.08, 2.366+0.04, 2.383+0.02, 2.419, 2.470, 2.486, 2.511, 2.549, 2.596, 2.643, 2.711-.01, 2.818-.045, 2.893-.100] | |
return np.interp(energies, eV, n) |
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
plotstyle = "basis" | |
#plotstyle = "amplitude" | |
decimatex = 20 | |
ncomponents = 5 | |
a = ys[:, ::decimatex] | |
xs = xs[:, ::decimatex] | |
U, s, V = np.linalg.svd(a, full_matrices=True) | |
if plotstyle=="basis": | |
for x, y, label in zip(xs[:ncomponents], V[:ncomponents], range(ncomponents)): |
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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
""" | |
Program accepts two parameters: image1 image2 | |
Both files have to have the same dimension. Any format accepted by scipy is possible. | |
They may be grayscale or RGB, in the latter case the R+G+B value is taken. |
OlderNewer