Skip to content

Instantly share code, notes, and snippets.

View gadamc's full-sized avatar

G Adam Cox gadamc

  • Q-CTRL
  • Seattle, WA
  • 06:23 (UTC -12:00)
View GitHub Profile
@gadamc
gadamc / plotVtime.py
Created June 4, 2011 06:12
create a tgraph for the mean amplitude versus time and correlated with temperature
#!/usr/bin/env python
from ROOT import *
import os, sys
import numpy as np
def main(*args):
runFile = os.path.join('/sps/edelweis/kdata/data/current/raw', os.path.basename(args[0]))
boloName = args[1]
@gadamc
gadamc / runJobs.py
Created June 4, 2011 06:14
start jobs on cc GE cluster and use the database to get files that are ready for analysis
#!/usr/bin/env python
from couchdbkit import Server,Database
import os, subprocess, sys
def main():
datadir = '/sps/edelweis/kdata/data/current'
firstRun = 'le26a000'
lastRun = 'zz99z999'
@gadamc
gadamc / muonvetohvcron.sh
Created June 4, 2011 12:18
scripts to monitor muon veto high voltage
#!/bin/bash
MuonVetoHVHome=/home/edelweiss/Programme/HV-cmd
export PYTHONSTARTUP=/etc/pythonstart
PYTHONPATH=/usr/local/bin/python
cd $MuonVetoHVHome && $PYTHONPATH ./muonvetohvlog.py
sleep 30
cd $MuonVetoHVHome && $PYTHONPATH ./muonvetohvemailwarning.py
from ROOT import *
import numpy as np
from scipy import stats
from scipy import signal
def fill(h,v):
h.SetBins(len(v), 0 , len(v))
for i in range(len(v)):
h.SetBinContent(i+1, v[i])
@gadamc
gadamc / gist:1082583
Created July 14, 2011 14:43
plot t_bolo v co
#!/usr/bin/env python
from couchdbkit import Server, Database
from ROOT import TFile, TH1D
import numpy as np
import sys
s = Server(sys.argv[1])
db = s[sys.argv[2]]
fout = TFile('tbolo_co_july8to14.root','recreate')
@gadamc
gadamc / couchMod.py
Created August 1, 2011 14:21
short script to modify some docs on our couch
#!/usr/bin/env python
from couchdbkit import Server, Database
import sys, os, copy
s = Server('http://***:***@127.0.0.1:5984')
db = s['edwdb']
vr = db.view('proc/daqdoc', reduce=False)
# Q E_recoil sigma_ion sigma_heat voltage_bias
0.707166 6.45045 1.02629 1.04127 8
1.01045 8.87014 0.726222 2.31162 8
0.974034 9.7642 0.814962 0.822313 8
1.4773 5.81705 0.666992 2.03295 8
1.10082 9.46519 0.765231 0.803824 6.4
0.738693 27.9404 0.839768 0.838095 8
0.759251 12.9018 0.734915 0.864414 6.4
0.997683 10.3843 0.789633 0.999154 8
1.08581 9.43259 0.80085 0.848234 8
//______________________________________________________________________
//
// KCurl.cxx
// Author: Adam Cox <mailto:adam.cox@kit.edu>
//
// *Copyright 2011 Karlsruhe Inst. of Technology. All Rights Reserved.
//
//
// Created Friday 04. February 2011
//
@gadamc
gadamc / test.C
Created August 22, 2011 15:05
example of using the FIR filter and filling in a KAmpEvent file.
//start root.
//compile this file
// root [0] .L test.C+g
//run the program
// root [1] test();
//Of course, this won't work because you have to point KDataReader and KDataWriter
//to the appropriate files.
#ifndef __CINT__
#include "KDataReader.h"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import struct
class ipebb21mode(object):
def __init__ (self, filename):