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 / moving_average
Last active December 26, 2015 20:39
Moving average with ghosted lines
plot_ma <- function(d, start_lwd=0.9, start_gray=0.5, ...) {
if(!is.data.frame(d))
d <- as.data.frame(d)
iter <- as.integer(floor(log(nrow(d), base=10)))
dlwd <- (1.5 - start_lwd) / iter
dgray <- (0.9 - start_gray) / iter
pargs <- substitute(...)
@whitead
whitead / gr_hh.txt
Last active July 25, 2019 09:52
Neutron diffraction derived radial distribution function of water. Data from A. K. Soper, Chem. Phys. 258, 121 2000 and extracted by me. Units are Angstroms and g(r). Step size is 0.001 from 0 to 15.
0 0
0.001 5.94285714285717e-05
0.002 0.000118857142857143
0.003 0.000178285714285715
0.004 0.000237714285714287
0.005 0.000297142857142859
0.006 0.00035657142857143
0.007 0.000416000000000002
0.008 0.000475428571428574
0.009 0.000534857142857146
@whitead
whitead / gist:9325454
Last active August 29, 2015 13:56
Lammps Replay Snippet
#the 3 is the number of frames in the trajectory to replay
variable i loop 3
#the stride is the time between frames
variable stride equal 1
#set-up run here, including reading data/restart file
...
...
...
@whitead
whitead / MSDNB
Last active August 29, 2015 14:11
MSD Notebook
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@whitead
whitead / animate.py
Created March 7, 2015 15:40
Gif Animator
def stuff():
print "Here"
@whitead
whitead / Instructions.md
Last active August 29, 2015 14:16
Gif Magic

Prequisites: If you're on windows, you'll need to view file extensions. Go to the start menu and type Show or hide file extensions. The first search result will be a control panel setting for accomplishing this. There are checkboxes there. Make sure Show hidden files, folders, and drives is checked and Hide extensions for known file types is NOT checked.

Install Beautiful Soup 4. Type the command below in a command prompt (where you run ipython notebook)

conda install -c https://binstar.org/ioos beautifulsoup4

Install Mechanize:

conda install -c https://conda.binstar.org/dhirschfeld mechanize
@whitead
whitead / lj.lammps
Last active August 29, 2015 14:21
Lammps Tutorial Stuff
units lj #Lennard Jones - derived units
atom_style atomic #This says, we're using particles with interatomic forces
#THESE ARE MAGIC!
neighbor 1 bin
atom_modify map array sort 10 6
#-------------------------------------------------
#----------THESE COMMANDS SET-UP SIM BOX----------
@whitead
whitead / milton.json
Last active August 29, 2015 14:21
Milton
{
"A": 0.75,
"R": 0.96,
"N": 1.26,
"D": 1.07,
"C": 0.8,
"Q": 0.83,
"E": 0.80,
"G": 1.47,
"H": 0.96,
@whitead
whitead / example.mplstyle
Created February 4, 2016 15:25
Example MPLStyle File
#set the font-size and size of things
figure.figsize: 5, 3
axes.labelsize: 14.3
axes.titlesize: 15.6
xtick.labelsize: 13
ytick.labelsize: 13
legend.fontsize: 13
grid.linewidth: 1.3
lines.linewidth: 2.275
@whitead
whitead / lecture.ipynb
Created February 9, 2016 17:24
Unit 5 Lecture 1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.