This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Author: Joe Futrelle | |
| * License: CC0 - Free as in freedom | |
| */ | |
| /** | |
| * ATtiny85 direct digital synthesis | |
| * using MCP4725 12-bit I2C DAC | |
| * TWI is handled using Atmel's USI TWI implementation | |
| * which is provided as part of Application Note AVR310 | |
| * http://www.atmel.com/Images/Atmel-2561-Using-the-USI-Module-as-a-I2C-Master_AP-Note_AVR310.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <avr/io.h> | |
| #include <avr/interrupt.h> | |
| #include <avr/wdt.h> | |
| #include <avr/sleep.h> | |
| #include <util/delay.h> | |
| // cribbing from http://electronics.stackexchange.com/a/74850 | |
| void prevent_wdt_reset() { | |
| if(MCUSR & _BV(WDRF)){ // If a reset was caused by the Watchdog Timer... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Name: main.c | |
| * Author: Joe Futrelle | |
| * License: CC0 - Free as in freedom | |
| */ | |
| /* Adafruit 4-digit alphanumeric backpack, I2C | |
| * Via USI_TWI_master from application note AVR310 | |
| * http://www.atmel.com/Images/Atmel-2561-Using-the-USI-Module-as-a-I2C-Master_AP-Note_AVR310.pdf | |
| */ | |
| /* Datasheet for HT16K33 | |
| * http://www.adafruit.com/datasheets/ht16K33v110.pdf |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <namespace name="ifcb.utils"> | |
| <rule name="reorg_products" include="src dest"> | |
| <invoke rule="ifcb.files.find_data_dirs"/> | |
| <!-- directory=product root dir, product=product type --> | |
| <any> | |
| <test var="product" eq="blobs"> | |
| <path var="src" match="${directory}/[0-9]*/[0-9]*/*_blobs_v2.zip"/> | |
| <match var="src" pattern=".*/((.*_blobs).*)" groups="product_filename pid"/> | |
| <invoke rule="ifcb.pid"/> | |
| </test> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import re | |
| import time | |
| from urllib2 import urlopen | |
| import json | |
| FEED_URL='http://ifcb-data.whoi.edu/mvco/feed.json' | |
| DATA_DIR='/data' | |
| FORMATS=('hdr','adc','roi') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Wire.h> | |
| #define EEP_ADDR 0x50 | |
| void dump(); | |
| void setup() | |
| { | |
| Wire.begin(); // join i2c bus (address optional for master) | |
| Serial.begin(9600); // start serial for output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/env/python | |
| import sys | |
| import os | |
| import numpy as np | |
| import pandas as pd | |
| from pandas.io.parsers import read_csv | |
| BASE_PATH='/media/F_DRIVE/FSM 2014' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/env/python | |
| import os | |
| from glob import glob | |
| from tifffile import TiffFile | |
| BASE_DIR='{whatever}' | |
| for tfpath in sorted(glob(os.path.join(BASE_DIR,'*.tif'))): | |
| tf = TiffFile(tfpath) | |
| tfn = os.path.basename(tfpath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from skimage.feature import peak_local_max | |
| from skimage.filter import threshold_otsu | |
| import scipy.ndimage as ndi | |
| def count_bright(Y): | |
| t = threshold_otsu(Y) | |
| D = ndi.distance_transform_edt(Y > t) | |
| Pl = peak_local_max(D,indices=False) | |
| _, count = ndi.label(Pl) | |
| return count |