Skip to content

Instantly share code, notes, and snippets.

@dwblair
dwblair / librarylinker
Created Sep 17, 2012
Linking Arduino libraries for the open-lab-monitor
View librarylinker
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 Jun 3, 2013
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 …
View genNDVI.py
#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 Jun 3, 2013
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 …
View genNDVI.py
#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.
View processNGB.py
#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.
View processNGB.py
#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.
View open-log.ino
// 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 Jun 7, 2013
logging to open-log.pvos.org with a dht22 monitor
View open_log2_dht22.ino
// 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"
View open-log2_dht11
// 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"
View olm-dht22-test.ino
// 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 Aug 1, 2013
Generating a LUT in the format "DN,R,G,B" from the colormap data structure used by matplotlib.
View cmap2LUT.py
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)