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. |
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 | |
try: | |
with open('num.txt') as ff: | |
num = int(ff.read())+1 | |
except FileNotFoundError: | |
num=1 | |
numstr = '{:02d}'.format(num) | |
print(numstr) | |
with open('num.txt', 'w') as ff: |
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 = 1 | |
ncomponents = 6 | |
a = ys[:, ::decimatex] | |
xs = xs[:, ::decimatex] | |
U, s, V = np.linalg.svd(a, full_matrices=False) | |
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
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 python3 | |
#-*- coding: utf-8 -*- | |
import os, sys | |
#import fileinput | |
AAA, BBB = u'¬ ì¡ ýØç槣§ççå¬ Øý', u'éčůčýíář욊žÚčžššňČěřň' | |
filelist = [os.path.join(dp, f) for dp, dn, fn in os.walk('.') for f in fn] | |
filelist.sort() |
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 | |
# tb.py Richard P. Muller, 5/2000 | |
# Updated for numpy.linalg and matplotlib by Filip Dominec, 2016 | |
# This program is the tight-binding program for Diamond/Zincblende | |
# structures that is presented in Chadi and Cohen's paper | |
# "Tight-Binding Calculations of the Valence Bands of Diamond and | |
# Zincblende Crystals", Phys. Stat. Soli. (b) 68, 405 (1975). This | |
# program is written for diamond and zincblende structures only. |
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
#!/bin/bash | |
fn_bash() { for x in "$@"; do echo $x; done; } | |
echo '#!/usr/bin/env python' > printer.py | |
echo 'import sys ' >> printer.py | |
echo 'for a in sys.argv: print a' >> printer.py | |
chmod +x printer.py | |
fn() { ./printer.py "$@" ; } | |
echo 'Example 1 supplies the arguments at the line of function call and prints 3 lines, as we need' |
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
#!/bin/bash | |
cd /home/SLIDESHOW | |
sleep 60 | |
gphoto2 --capture-tethered --keep & | |
# geeqie -f latest/slideshow.jpg & | |
geeqie -f -s & | |
while true ; do cp `ls *JPG -1tr | tail -n 1` latest/slideshow.jpg ; sleep 2 ; done | |
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 -*- | |
## Import common moduli | |
import matplotlib, sys, os, time | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from scipy.constants import c, h, hbar, pi, k, e | |
import scipy.integrate |