#!/usr/bin/env python # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # # (c) Jeffrey M. Hokanson # Started 4 June 2014 import imd import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np import sys data = imd.read('test.imd') fig = plt.figure(tight_layout = True) gs = gridspec.GridSpec(data.ncol,1, wspace = 5.0, hspace = 0.0) ax = [] for j in range(data.ncol): ax.append(plt.subplot(gs[j,0])) fig.subplots_adjust(left = 0.02, right = 0.98, top = 1, bottom = 0.05) start = 0 step = 1000 def move(event): global start, step, ax, fig, data print 'key = {}'.format(event.key) if event.key in ['ctrl+c', 'ctrl+C']: sys.exit(0)
# iterate over each row, if no other signal in anyother channel, apltend value for row in x: i = row.nonzero()[0] if len(i) == 1: single_counts[i].append(float(row[i])) start += blocksize return single_counts if __name__ == "__main__": filename = sys.argv[1] data = imd.read(filename) data.round_dual = False single_counts = background(data) bins = range(100) for j in range(data.ncol): plt.figure() ax = plt.subplot(111) plt.hist(single_counts[j], bins) plt.title(data.markers[j] + ' :: ' + data.tags[j]) ax.set_yscale('symlog', linthreshy = 1) plt.show()