source: fact/tools/pyscripts/sandbox/dneise/spike_studies/basic.py@ 17633

Last change on this file since 17633 was 13460, checked in by neise, 13 years ago
evolving
  • Property svn:executable set to *
File size: 708 bytes
Line 
1#!/usr/bin/python -tt
2#
3# Example
4# * looping over RawData class object
5#
6
7from pyfact import RawData
8from drs_spikes import DRSSpikes_2D
9from plotters import Plotter
10import matplotlib.pyplot as plt
11import sys
12
13data_filename = 'data/20120223_210.fits.gz'
14calib_filename = 'data/20120223_206.drs.fits.gz'
15
16plt.ion()
17
18def plot_spikes(despiker, data):
19 #single figure
20 sf = plt.figure('singles')
21
22
23
24run = RawData(data_filename, calib_filename, return_dict = True, do_calibration=True)
25despike = DRSSpikes_2D(user_action=plot_spikes)
26
27for event in run:
28 index = event['event_id'].value
29 print event['trigger_type'].value ,
30 if index == int(sys.argv[1]):
31 sys.exit(0)
32
Note: See TracBrowser for help on using the repository browser.