Skip to content

Instantly share code, notes, and snippets.

View cfangmeier's full-sized avatar
🥓

Caleb Fangmeier cfangmeier

🥓
  • Boston University
  • Lincoln, NE
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
int humd_pin = A0;
int temp_pin = A1;
int temp_val = 0;
int humd_val = 0;
float temp = 0; // Temperature in F
float temp_c = 0; // Temperature in C
float humd = 0;
@cfangmeier
cfangmeier / gscript.md
Last active August 21, 2019 22:19
gScript Documentation

gScript (Gantry Script) Documentation

gScript is an interpreted language similar to assembly. A gScript source code file is a plain text file with one statement per line. Statements are executed in sequence from top to bottom. A statement has the form

COMMAND ARG0 ARG1 ... ARGN

COMMAND must be one of the build in commands as specified below. Arguments can be of various forms, including numeric and string literals, variables, or references to memory. The syntax for these forms will be described below.

@cfangmeier
cfangmeier / step2Content.txt
Created November 14, 2017 01:06
Event Content of step2 Files
Type Module Label Process
-------------------------------------------------------------------------------------------------
GenEventInfoProduct "generator" "" "SIM"
LHEEventProduct "externalLHEProducer" "" "SIM"
edm::HepMCProduct "generatorSmeared" "" "SIM"
edm::RandomEngineStates "randomEngineStateProducer" "" "SIM"
edm::TriggerResults "TriggerResults" "" "SIM"
vector<PCaloHit> "g4SimHits" "CaloHitsTk" "SIM"
vector<PCaloHit> "g4SimHits" "CastorBU" "SIM"
vector<PCaloHit> "g4SimHits" "CastorFI" "SIM"
@cfangmeier
cfangmeier / urllib2_ssl.py
Last active May 29, 2020 09:57 — forked from zed/urllib2_ssl.py
SSL client/server certificates verification for `urllib2`. :python:ssl:
"""SSL client/server certificates verification for `urllib2`.
see: https://gist.github.com/zed/1347055
It works on Python 2.6, 2.7, 3.1, 3.2
Example::
>>> import urllib2, urllib2_ssl
>>> opener = urllib2.build_opener(urllib2_ssl.HTTPSHandler(
@cfangmeier
cfangmeier / Healthcare_CMS_Pull.py
Last active January 25, 2016 00:24
HHC Pull Data
#!/usr/bin/env python3
import io
import os
import json
import csv
import logging
import zipfile
import concurrent.futures
import urllib.request as request
from collections import namedtuple
!clc
!clear
data = dlmread('./1.txt','\t');
f = log(data(:,1)); #focus
h = data(:,2); #height
N = size(f)(1);
#G = H + A*np.exp(-((x-mu)/sigma)**2)
#H: c(1)
#A: c(2)
@cfangmeier
cfangmeier / fiducials.cpp
Last active August 29, 2015 14:06
Gantry Vision Code
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <string>
#include <set>
using namespace cv;
using namespace std;
@cfangmeier
cfangmeier / keithley2410_SweepTest.py
Last active April 22, 2022 11:40
Creates an IV curve using Keithley 2410 Sweep Function
#!/usr/bin/env python3
import serial
import matplotlib.pyplot as plt
script = """
# hashes make comments
# @ on a read specifies the parser for the read data
*RST
:SENS:FUNC:CONC OFF #Turn off concurrent functions
@cfangmeier
cfangmeier / plot_weight.py
Last active August 29, 2015 14:04
graphs weight over time, recorded daily using jrnl
#!/usr/bin/env python3
import matplotlib as mat
import matplotlib.pyplot as plt
import subprocess
import datetime
if __name__ == '__main__':
raw = subprocess.check_output('jrnl @weight'.split())
data = raw.decode('ascii').splitlines()