Skip to content

Instantly share code, notes, and snippets.

View jrleeman's full-sized avatar

John Leeman jrleeman

View GitHub Profile
This file has been truncated, but you can view the full file.
DateTime,Latitude,Longitude,Depth,Magnitude,MagType,NbStations,Gap,Distance,RMS,Source,EventID
1980/01/01 01:24:37.20,12.3530,95.1920,20.00,5.10,Mb,97,,,0.00,NEI,198001014001
1980/01/01 02:45:54.00,27.2610,60.2590,33.00,5.30,Mb,123,,,0.00,NEI,198001014003
1980/01/01 04:56:03.40,38.6020,69.5200,33.00,4.20,Mb,7,,,0.00,NEI,198001014005
1980/01/01 07:53:30.62,60.1800,-152.2200,92.00,4.10,ML,0,,,,AK,
1980/01/01 11:18:20.20,-15.9580,26.0850,33.00,4.10,Mb,6,,,0.00,NEI,198001014009
1980/01/01 12:46:18.80,-17.8390,168.0850,61.00,4.80,Mb,6,,,0.00,NEI,198001014010
1980/01/01 13:48:04.20,13.8040,-90.7330,59.00,4.60,Mb,23,,,0.00,NEI,198001014011
1980/01/01 14:46:19.20,6.8390,-73.0660,163.00,4.70,Mb,14,,,0.00,NEI,198001014012
1980/01/01 15:55:59.60,-15.6210,26.3150,33.00,4.20,Mb,6,,,0.00,NEI,198001014013
@jrleeman
jrleeman / part1.ipynb
Last active August 29, 2015 13:57
Inversion Theory Example of Finding a Black Box Pinger
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / ReadBinSeismo.m
Created April 17, 2014 13:12
Readers For Laboratory Acoustic Data
function[seismo,size] = ReadBinSeismo(fname)
fid = fopen(fname,'rb');
size = fread(fid,2,'int');
size(2)
seismo = fread(fid,size(2),'double')
fclose(fid)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / PressureLogger.ino
Created June 17, 2014 19:59
Pressure Temperature Logger for Arduino Data Shield
#include <SD.h>
#include <Wire.h>
#include "RTClib.h"
// Data logger for temperature and pressure data using the Adafruit
// logger shield.
// Logging Interval (milliseconds)
#define LOG_INTERVAL 60000
@jrleeman
jrleeman / RadarTest.ipynb
Created July 3, 2014 03:12
Spectrogram plotting demo for radar data. Requested via Twitter.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jrleeman
jrleeman / tilt_logger_system.ino
Last active August 29, 2015 14:18
Logs tilt meter and GPS data from a Jewell D700 tilt meter and Adafruit Ultimate GPS logger shield.
#include <SPI.h>
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
#include <SD.h>
#include <avr/sleep.h>
// Make software serial port for GPS and GPS instance
SoftwareSerial mySerial(8, 7);
Adafruit_GPS GPS(&mySerial);
@jrleeman
jrleeman / pp_control_file.py
Created April 15, 2015 12:11
Make pore pressure oscillation control files for the PSU biax.
import numpy as np
import sys
period = input("Period [sec]: ")
n_cycles = input("Number of Cycles: ")
fs = input("Update Rate [Hz]: ")
amp = input("Amplitude [MPa]: ")
print "\n\nCalibrations:\nL: 0.146059 V/MPa\nH: 1.4702 V/MPa\n"
gain = raw_input("[L]ow or [H]igh Gain: ")
@jrleeman
jrleeman / sac_converter.py
Created May 29, 2015 14:49
Convert Lab Format Data to SAC
import numpy as np
import os
import sys
from obspy.core import *
from datetime import datetime
class recordSet(object):
def __init__(self, path):
self.traces = []
@jrleeman
jrleeman / acoustics_sorter.py
Created May 30, 2015 14:14
Sorts acoustics records into folders to make management easier.
import os
import re
cwd = os.getcwd()
fnames = os.listdir(cwd)
# Find the log files
log_pattern = re.compile('^.*log.txt')
log_files = filter(log_pattern.search, fnames)