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
| /* | |
| print_time() returns a string in the format mm-dd-yyyy hh:mm:ss | |
| */ | |
| #include "RTClib.h" | |
| #include <SD.h> | |
| #include <SPI.h> | |
| RTC_DS1307 rtc; | |
| const int chipSelect = 10; |
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
| ''' | |
| Written by David Hagan | |
| January 8, 2015 | |
| This script reads data from the Bacharach ECA 450 Combustion analyzer through the serial interface and | |
| logs the data to a file | |
| In the future (If I ever use the Bacharach again), I aim to convert this into a GUI for ease of use. | |
| Description of Columns: |
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
| ''' | |
| This is an example script displaying how to easily run the | |
| Alphasense OPC-N2 from a Raspberry Pi using the py-opc library. | |
| Author: David H Hagan | |
| Email: david@davidhhagan.com | |
| Date: 2015-06-16 | |
| ''' | |
| from opc import OPCN2 |
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
| fig, ax = plt.subplots(1, 1) | |
| with sns.axes_style('white'): | |
| ax.plot(final.index, final['AFE1_X2-01_degC'], label = 'T RTD-X2-01') | |
| ax.plot(final.index, final['AFE2_X2-01_degC'], label = 'T RTD-X2-01b') | |
| ax.plot(final.index, final['AFE1_X2-02_degC'], label = 'T RTD-X2-02') | |
| ax.plot(final.index, final['AFE2_X2-02_degC'], label = 'T RTD-X2-02b') | |
| ax.set_title("X2-Series RTD Intercomparison") | |
| ax.set_xlabel("Local Time (EST)") | |
| ax.set_ylabel("T degC") |
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
| {% macro form_field(field) -%} | |
| {% set with_label = kwargs.pop('with_label', False) %} | |
| {% set placeholder = '' %} | |
| {% if not with_label %} | |
| {% set placeholder = field.label.text %} | |
| {% endif %} | |
| <div class="control-group {% if field.errors %}error{% endif %}"> | |
| {% if with_label %} | |
| <label for="{{ field.id }}" class="control-label"> | |
| {{ field.label.text }}{% if field.flags.required %} *{% endif %}: |
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 requests | |
| import json | |
| class API(object): | |
| def __init__(self, **kwargs): | |
| self._key = kwargs.pop('key', '') | |
| self._pswd = kwargs.pop('pswd', '') | |
| self._version = kwargs.pop('version', None) | |
| self._baseurl = kwargs.pop('baseurl', None) | |
| self._headers = {'content-type': 'application/json'} |
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 pandas as pd | |
| import numpy as np | |
| import math | |
| import matplotlib.pyplot as plt | |
| from matplotlib.ticker import ScalarFormatter | |
| import seaborn as sns | |
| import warnings | |
| class DataError(TypeError): | |
| pass |
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
| """ | |
| Simple script to run the Alphasense OPC-N2 using the py-opc library. | |
| Written by David H Hagan | March 24, 2016 | |
| """ | |
| import spidev | |
| import opc | |
| from time import sleep |
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
| """ | |
| This script runs the Alphasense OPC-N2 via the USB-ISS adapter and logs | |
| every X seconds | |
| Written by David H Hagan | Dec. 2016 | |
| Contact: dhagan@mit.edu | |
| """ | |
| import usbiss | |
| import opc |
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
| """ | |
| This function accepts a matplotlib axis object with a datetime x-axis | |
| and performs magical things to it to make it look not like total shit. | |
| """ | |
| import matplotlib.dates as dates | |
| import matplotlib.ticker as mtick | |
| import datetime | |
| def label_july_only(x, pos=None): |
OlderNewer