sine_subtract_min_freq_GHz = 0.03 sine_subtract_max_freq_GHz = 0.09 sine_subtract_percent = 0.03 final_corr_length = 2**14 run = int(run) time_window = 5 * 60 #seconds frequency_bin_edges_MHz = numpy.arange(0, 150, 5) antennas_of_interest = numpy.array([4, 5]) trigger_types_of_interest = numpy.array([1, 3]) save = True plot = False reader = Reader(datapath, run) try: print(reader.status()) except Exception as e: print('Status Tree not present. Returning Error.') print('\nError in %s' % inspect.stack()[0][3]) print(e) exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] print(exc_type, fname, exc_tb.tb_lineno) sys.exit(1) filename = createFile( reader ) #Creates an analysis file if one does not exist. Returns filename to load file. if filename is not None: with h5py.File(filename, 'a') as file:
eventid = [2401] for eid in eventid: reader.setEntry(eid) ## dump the headers and status, just to show they're there if verbose == True: print('\nReader:') pprint(tools.interpret.getReaderDict(reader)) print('\nHeader:') pprint(tools.interpret.getHeaderDict(reader)) print('\nStatus:') pprint(tools.interpret.getStatusDict(reader)) reader.header().Dump() reader.status().Dump() #print reader.N() # plot all waveforms plt.figure() for i in range(4): if i == 0: ax = plt.subplot(4, 1, i + 1) plt.plot(reader.t() - 5200, reader.wf(2 * i)) else: plt.subplot(4, 1, i + 1, sharex=ax, sharey=ax) plt.plot(reader.t() - 5200, reader.wf(2 * i)) if i in [0, 1, 2, 3]: plt.ylabel('V (adu)') if i == 3: plt.xlabel('t (ns)')