Skip to content

Instantly share code, notes, and snippets.

@dwblair
dwblair / librarylinker
Created September 17, 2012 21:42
Linking Arduino libraries for the open-lab-monitor
cd ~/sketchbook
mkdir libraries
cd libraries
ln -s [path to repo dir]/arduino/libraries/ThermistorLib
ln -s [path to repo dir]/arduino/libraries/SerialComman
@dwblair
dwblair / genNDVI.py
Created June 3, 2013 18:08
Takes an input directory of NGB image files and outputs NDVI images to an output directory. Invoke with "python genNDVI.py inputDir outputDir VMIN VMAX histogramOption, where inputDir is a directory of images, outputDir is the target directory, VMIN and VMAX are the min / max for the NDVI values to be display via a colormap, and histogramOption …
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
@dwblair
dwblair / genNDVI.py
Created June 3, 2013 18:08
Takes an input directory of NGB image files and outputs NDVI images to an output directory. Invoke with "python genNDVI.py inputDir outputDir VMIN VMAX histogramOption, where inputDir is a directory of images, outputDir is the target directory, VMIN and VMAX are the min / max for the NDVI values to be display via a colormap, and histogramOption …
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
@dwblair
dwblair / open-log.ino
Last active December 18, 2015 04:28
Posting from OLM to http://open-log.pvos.org/ ...
// Simple demo for feeding some random data to Open-Log
// 2013-06-06 http://opensource.org/licenses/mit-license.php
#include <EtherCard.h>
// change these settings to match your own setup
#define FEED "3"
#define APIKEY "bananas"
@dwblair
dwblair / open_log2_dht22.ino
Created June 7, 2013 01:21
logging to open-log.pvos.org with a dht22 monitor
// Simple demo for feeding some random data to Open-Log
// 2013-06-06 http://opensource.org/licenses/mit-license.php
#include <EtherCard.h>
// change these settings to match your own setup
#define FEED "3"
#define APIKEY "bananas"
// Simple demo for feeding some random data to Open-Log
// 2013-06-06 http://opensource.org/licenses/mit-license.php
#include <EtherCard.h>
// change these settings to match your own setup
#define FEED "3"
#define APIKEY "bananas"
@dwblair
dwblair / olm-dht22-test.ino
Created June 9, 2013 04:51
test of the dht11. tutorial re: how to hook it up here: http://learn.adafruit.com/dht/connecting-to-a-dhtxx-sensor
// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
#include "DHT.h"
#define DHTPIN 3 // what pin we're connected to
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22 (AM2302)
@dwblair
dwblair / cmap2LUT.py
Created August 1, 2013 20:07
Generating a LUT in the format "DN,R,G,B" from the colormap data structure used by matplotlib.
import matplotlib as mpl
import matplotlib.cm as cm
import numpy as np
norm = mpl.colors.Normalize(vmin=0, vmax=255)
cmap = cm.spectral
m = cm.ScalarMappable(norm=norm, cmap=cmap)
for i in range(0,256):
vals=m.to_rgba(i)