#!/usr/bin/python -tt # # Example # * looping over RawData class object # from pyfact import RawData from drs_spikes import DRSSpikes_2D from plotters import Plotter import matplotlib.pyplot as plt import sys data_filename = 'data/20120223_210.fits.gz' calib_filename = 'data/20120223_206.drs.fits.gz' plt.ion() def plot_spikes(despiker, data): #single figure sf = plt.figure('singles') run = RawData(data_filename, calib_filename, return_dict = True, do_calibration=True) despike = DRSSpikes_2D(user_action=plot_spikes) for event in run: index = event['event_id'].value print event['trigger_type'].value , if index == int(sys.argv[1]): sys.exit(0)