Skip to content

Instantly share code, notes, and snippets.

View jrleeman's full-sized avatar

John Leeman jrleeman

View GitHub Profile
@jrleeman
jrleeman / Natural_Neighbor_Test_Case.ipynb
Created March 15, 2017 16:55
Test case for MetPy's Natural Neighbor Interpolation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / LFC_Development.ipynb
Created July 26, 2016 00:57
Testing which way to calculate line intersections is the fastest
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / LFC_Development.ipynb
Created July 26, 2016 00:56
Testing which way to calculate line intersections is the fastest
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / rsf_widgets.ipynb
Created May 25, 2016 17:45
RSF Dashboard Demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / FiPy Solver With Source.ipynb
Created April 18, 2016 20:27
Shear heating and diffusion modeling.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / datastamp.py
Created March 21, 2016 20:24
Takes data with relative time stamps, interpolates, down samples, and absolute time stamps for processing.
import numpy as np
import datetime
import matplotlib.pyplot as plt
import math
import scipy
import argparse
def mean_downsample(a, args.r):
pad_size = math.ceil(float(a.size)/args.r)*args.r - a.size
@jrleeman
jrleeman / StrainMeterDemo.ino
Last active November 24, 2015 00:49
Reads strain gauge load cell with HX711 and controls large pointer.
#include <HX711.h>
#include <Servo.h>
#define DOUT 3
#define CLK 2
#define SERVOPIN 9
const int nAvg=5;
const int nXPixels=160;
const int nYPixels=128;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / ReadBinBiax.m
Created October 12, 2015 16:47
Biax binary file reader by Path B. for MATLAB users.
% Function for reading the binary file from the biax, the Marone lab calls
% this the lk file
function [data,outname] = ReadBinBiax(runname)
% Input: runname, a string of the form 'pxxxx'. The code expects the data
% file to be in foo/pxxx/data/pxxx_data.bin. Edit the variable mechfname
% and the filename argument for fidbiax to suit your needs.
% Output: 1) data: data matrix with all relevant columns appended with the biax
% column as the first column (refer line 65),
% 2) outname: header info of the lk file. Edit the outname variable
% to change to your choice of file structure.
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
volatile unsigned long firstPulseTime;
volatile unsigned long lastPulseTime;
volatile unsigned long numPulses;