Skip to content

Instantly share code, notes, and snippets.

View dbuscombe-usgs's full-sized avatar
🎯
Focusing

Daniel Buscombe dbuscombe-usgs

🎯
Focusing
View GitHub Profile
@dbuscombe-usgs
dbuscombe-usgs / play.py
Last active December 25, 2015 17:59
play
#:smile:
@dbuscombe-usgs
dbuscombe-usgs / pymix_fix.py
Created October 15, 2013 21:47
fix for installing pymix on ubuntu using python 2.6 or 2.7
# 3 steps
# 1) in setup.py
# change
from distutils.core import setup, Extension,DistutilsExecError
#to:
from distutils.core import setup, Extension
from distutils.errors import DistutilsExecError
@dbuscombe-usgs
dbuscombe-usgs / starting_right.py
Last active December 25, 2015 10:08
example of how i like to pass arguments to python programs
# these are the libraries needed
import sys, getopt
from Tkinter import Tk
from tkFileDialog import askopenfilename
import numpy as np
# get list of input arguments and pre-allocate arrays
argv = sys.argv[1:]
inputfile = ''; arg2 = ''
arg3 = ''; arg4 = ''
@dbuscombe-usgs
dbuscombe-usgs / simple_kivy_cam.py
Last active May 16, 2022 14:10
Simple python script to capture a screengrab from your webcam (or some other camera) on the press of a button. Uses kivy.
import kivy
kivy.require('1.7.2')
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.camera import Camera
from kivy.uix.button import Button
from kivy.core.window import Window
class CamApp(App):
@dbuscombe-usgs
dbuscombe-usgs / xy2geojson.py
Created October 13, 2013 06:29
little python function to write a .geojson file to display a list of coordinates, x and y
f = open('points.geojson', 'w')
f.write('\n')
f.write('{\n')
f.write(' "type": "FeatureCollection",\n')
f.write(' "features": [\n')
for k in range(len(x)):
f.write('\n')
f.write(' {\n')
f.write(' "type": "Feature",\n')
f.write(' "geometry": {\n')
@dbuscombe-usgs
dbuscombe-usgs / fft_with_gmt.ipynb
Last active December 21, 2015 02:58
fft_with_gmt.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
177 cd mbsystem-5.3.2017/
180 nano Makefile
181 make clean
182 nano install_makefiles
183 make all
191 sudo yum install perl-Parallel-ForkManager.noarch
192 sudo yum groupinstall "X Software Development"
193 sudo yum install fftw.x86_64 fftw-devel.x86_64
194 sudo yum install kdebase3.x86_64
@dbuscombe-usgs
dbuscombe-usgs / geophotos2kml.m
Created July 27, 2013 16:13
Matlab script to search a list of directories and subdirectories of geo-tagged jpg images, organise them into a kml file show positions, times, file location and a thumbnail (needs exiftool)
close all;clear all;clc
addpath('/path/where/googleearth/toolbox/is')
% get main directory (Projects directory)
pathFolder=uigetdir();
% get list of subfolders
d = dir(pathFolder);
isub = [d(:).isdir];
nameFolds = {d(isub).name}';
export PS1='\[\033[1;34m\]\t\[\033[0m\] \[\033[1;35m\]\u\[\033[0m\]:\[\033[1;35m\]\W\[\033[0m\] \[\033[1;92m\]$(__git_ps1 "(%s)")\[\033[0m\]$ '
#In the terminal type
sudo rfkill unblock all
#then if you type
rfkill list all
#It should show something like: