import numpy as np from processing_layer.algorithms.CalcMomenEng import * import time from lib.onda.utils import ( global_params as gp, dynamic_import as dyn_imp ) de_layer = dyn_imp.import_layer_module('data_extraction_layer', gp.monitor_params) extractE = getattr(de_layer, 'extractE') from ImgAlgos.PyAlgos import PyAlgos import psana from mpi4py import MPI class MCPGate(): def __init__(self, parent, gateName, tofs, tofl,tofs_dict,tofl_dict): self.parent = parent self.gateName = gateName self.tofs = tofs self.tofl = tofl self.tofs_dict = tofs_dict self.tofl_dict = tofl_dict self.tofbin = self.parent.monitor_params['t']['bin'] print self.tofs_dict,self.tofl_dict
#Adapted from OnDA try: import configparser except ImportError: import ConfigParser as configparser import lib.onda.cfelpyutils.cfeloptarg as cfel_oa from lib.onda.utils import ( onda_optargs as onda_oa, global_params as gp, dynamic_import as dyn_imp ) args = onda_oa.parse_onda_cmdline_args() config = configparser.ConfigParser() config.read(args.ini) proc_params = cfel_oa.parse_parameters(config) gp.monitor_params = proc_params processing_layer = dyn_imp.import_layer_module('processing_layer', proc_params) Coin = getattr(processing_layer, 'Coin') proc = Coin(args.source, proc_params) proc.start(verbose=False)
) from ImgAlgos.PyAlgos import PyAlgos from processing_layer.algorithms.AcqirisPeakFinder import AcqirisPeakFinder from processing_layer.algorithms.BasicHitFinder import BasicHitFinder from PiPiCoGate import PiPiCoGate from TofGate import TofGate from MCPGate import MCPGate par_layer = dyn_imp.import_layer_module('parallelization_layer', gp.monitor_params) Workers = getattr(par_layer, 'Workers') class Coin(Workers): def init_params(self,monitor_params): self.npix_min, self.npix_max= monitor_params['Opal']['npix_min'],monitor_params['Opal']['npix_max'] self.amax_thr, self.atot_thr, self.son_min = monitor_params['Opal']['amax_thr'], monitor_params['Opal']['atot_thr'], monitor_params['Opal']['son_min'] self.thr_low, self.thr_high = monitor_params['Opal']['thr_low'], monitor_params['Opal']['thr_high'] self.rank, self.r0, self.dr = monitor_params['Opal']['rank'], monitor_params['Opal']['r0'], monitor_params['Opal']['dr'] self.eimg_center_x, self.eimg_center_y = monitor_params['Opal']['eimg_center_x'],monitor_params['Opal']['eimg_center_y']
import lib.onda.cfelpyutils.cfeloptarg as cfel_oa from lib.onda.utils import (onda_optargs as onda_oa, global_params as gp, dynamic_import as dyn_imp) if __name__ == "__main__": args = onda_oa.parse_onda_cmdline_args() config = configparser.ConfigParser() config.read(args.ini) monitor_params = cfel_oa.parse_parameters(config) gp.monitor_params = monitor_params processing_layer = dyn_imp.import_layer_module('processing_layer', monitor_params) Onda = getattr(processing_layer, 'Onda') mon = Onda(args.source, monitor_params) mon.start(verbose=False) import sys import numpy import signal import datetime import copy import pyqtgraph as pg signal.signal(signal.SIGINT, signal.SIG_DFL) app = QtGui.QApplication(sys.argv)