Skip to content

Instantly share code, notes, and snippets.

K. Arthur Endsley arthur-e

View GitHub Profile
arthur-e /
Created May 18, 2017
An example Python script for the Software Carpentry Python lesson (
Reports the min and max July temperatures for each file
that matches the given filename pattern.
import csv
import os
import sys
import glob
arthur-e /
Created Mar 10, 2017
An example Python script of using scikit-learn to learn water from non-water pixels
A module for machine learning on Landsat data; implemented and tested,
specifically, for learning water areas on an image. Performance so far:
Gaussian naive Bayes (where validation data chosen by the hydro mask):
Mean precision: Not water=0.9997, Water=0.3090
Mean recall: Not water=0.9787, Water=0.9763
Gaussian naive Bayes (where validation data inspected in Google Earth):
Mean precision: Not water=0.9675, Water=1.0000
arthur-e / aggregation.Rmd
Last active Aug 6, 2016
A comparison of aggregation methods in R using the Gapminder data from Data Carpentry
View aggregation.Rmd
title: "Aggregation in R"
author: "K. Arthur Endsley"
date: "August 4, 2016"
output: html_document
Let's explore multiple ways to aggregate data in R.
We'll do this to answer two questions:
arthur-e /
Last active Jun 30, 2020 — forked from tixxit/
Graham's scan convex hull algorithm, updated for Python 3.x
def convex_hull_graham(points):
Returns points on convex hull in CCW order according to Graham's scan algorithm.
By Tom Switzer <>.
def cmp(a, b):
return (a > b) - (a < b)
arthur-e / deaths_malaria.txt
Last active Jan 12, 2016
Prevalence of current tobacco use among adults (>=15 years) (%) both sexes, columns are: country name, 2002 prevalence (%), 2005 prevalence (%); all data from
View deaths_malaria.txt
country 2000 2001 2002 2003 2004 2005 2006
Algeria 0 0 0
Angola 96 66 98 254 80 86 62
Benin 10 6 9 7 11 4 16
Botswana 2 2 1 1 1 1 2
Burkina Faso 23 35 32 37 31 37 56
Burundi 9 6 7 6 9 25 5
Cameroon 5 5
Cape Verde 0 0 0 0 0 1
Central African Republic 14 10 21 16 20
arthur-e /
Created May 6, 2015
A walkthrough for building LEDAPS 2.2.0 and its dependencies from source on Ubuntu GNU/Linux 14.04
# NOTE: Could not determine which jpeg library should be installed; it's probably installed by default
sudo apt-get install libtiff5 libtiff5-dev libgeotiff2 libgeotiff-dev libxml2 libxml2-dev
sudo mkdir /usr/local/hdf4 && sudo chown $USERNAME /usr/local/hdf4 && cd /usr/local/hdf4
tar -xzvf hdf-4.2.11.tar.gz
cd hdf-4.2.11
arthur-e /
Last active Dec 19, 2019
Ubuntu for GIS Installation and Setup

Post-Installation Fixes and Setup

# Install compilers and linking tools; other tools
sudo apt-get install g++ swig curl build-essential python-all-dev

# Install package manager
sudo apt-get install synaptic

# Install Unity customization tool
sudo apt-get install unity-tweak-tool
arthur-e / colorBrewer.js
Created Apr 10, 2014
Generates higher-contrast sequential or diverging color palettes based on Cynthia Brewer's colors; outputs the same format as d3/lib/colorbrewer but colors are higher-contrast.
View colorBrewer.js
chroma = require('./node_modules/chroma-js/chroma.min.js');
function generatePalettes (type, reversed) {
var n, m;
var paletteNames;
var palettes = {};
if (type === 'sequential') {
paletteNames = [
'BuGn', 'BuPu', 'GnBu', 'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'RdPu',
arthur-e /
Last active Aug 29, 2015
Tool(s) to recover the Markdown contents from an older Springseed *.note file.
Recover the Markdown content of an older Springseed note (*.note) file. Output
*.md file names will be the name of the Note file prepended by the Notebook
name, if available.
import sys
import os
import re
import json
arthur-e /
Created Feb 17, 2014
An example Django command (through the or interface) for loading in generic CSV data; a design pattern that should apply well to just about any delimited data.
import csv
from import BaseCommand, CommandError
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db.models.fields import FieldDoesNotExist
from scour_server.nbi.models import Bridge
class Command(BaseCommand):
args = '<path>'
help = ''
You can’t perform that action at this time.