Skip to content

Instantly share code, notes, and snippets.

View whitead's full-sized avatar
:atom:

Andrew White whitead

:atom:
View GitHub Profile
@whitead
whitead / lecture.ipynb
Created March 24, 2016 16:38
unit 10 lecture 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whitead
whitead / lecture_2.ipynb
Created April 14, 2016 16:30
Unit 13 Lecture 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whitead
whitead / sanderson.ipynb
Created March 14, 2017 11:40
Brandon Sanderson Stochastic Bibliography Model
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whitead
whitead / convert_gr.py
Last active April 29, 2017 19:56
A simple tool to convert RDFs into smoothed coordination numbers for biasing in EDS
#!/usr/bin/env python
from scipy.integrate import *
from scipy.interpolate import interp1d
from math import pi, exp, sqrt,erf
import numpy as np
grtypes = ["gromacs", "lammps", "aimd"]
@whitead
whitead / some-owl-data.json
Created April 21, 2018 16:55
OWL Matches up to 4/21/2018
[
{
"home": "GLA",
"away": "FLA",
"scores": [
[
2,
1
],
[
@whitead
whitead / example.py
Created March 28, 2019 20:28
Moviepy and FFMPEG Example
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import moviepy
from moviepy.editor import VideoClip
from moviepy.video.io.bindings import mplfig_to_npimage
x = np.linspace(-5,5,100)
fig, ax = plt.subplots(figsize=(12,8))
line = ax.plot(x, x**2 + np.cos(5 * x))[0]
@whitead
whitead / make_movie.tcl
Created March 9, 2020 01:17
Rotate and Change Rep VMD Movie
proc take_picture {args} {
global take_picture
# when called with no parameter, render the image
if {$args == {}} {
set f [format $take_picture(format) $take_picture(frame)]
# take 1 out of every modulo images
if { [expr $take_picture(frame) % $take_picture(modulo)] == 0 } {
render $take_picture(method) $f
# call any unix command, if specified
@whitead
whitead / make_movie.tcl
Created March 9, 2020 01:19
Follow atoms with rotation
proc take_picture {args} {
global take_picture
# when called with no parameter, render the image
if {$args == {}} {
set f [format $take_picture(format) $take_picture(frame)]
# take 1 out of every modulo images
if { [expr $take_picture(frame) % $take_picture(modulo)] == 0 } {
render $take_picture(method) $f
# call any unix command, if specified
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('talk')
sns.set_style('darkgrid')
ps = [0.001, 0.005, 0.01, 0.02, 0.035]
cities = ['Rural Montana', 'Seattle', 'Minneapolis', 'Chicago', 'Miami']
cp = sns.cubehelix_palette(len(ps), start=0.5, rot=-0.75)
ALA ARG ASN ASP CYS GLN GLU HIS ILE LEU LYS MET PHE PRO SER THR TRP TYR VAL
ALA -0.34 0.08 0.04 0.15 -0.13 0.01 0.03 0.12 -0.2 -0.2 0.02 -0.18 -0.16 -0.01 0.03 -0.02 0.03 -0.02 -0.2
ARG 0.08 0.08 -0.08 -0.74 0.26 -0.2 -0.78 0.08 0.23 0.14 0.3 0.17 0.15 -0.1 -0.08 -0.03 -0.11 0.01 0.26
ASN 0.04 -0.08 -0.54 -0.47 0.12 -0.32 -0.26 -0.08 0.42 0.34 -0.25 0.23 0.14 -0.1 -0.32 -0.24 -0.01 0 0.25