def DetInit(self):
        self.ds = DataSource(self.args.exprun + \
                             ':smd:dir=/reg/d/psdm/amo/amolr2516/xtc:live')
        
        XTCAVRetrieval = ShotToShotCharacterization()
        XTCAVRetrieval.SetEnv(self.ds.env())

        self.SHES  = Detector(self.args.SHES)
        self.UXS = Detector(self.args.UXS)
	self.ITOF = Detector(self.args.ITOF)	
	self.XTCAV = Detector(self.args.XTCAV)
        self.EBeam = Detector(self.args.EBeam)
        self.GMD   = Detector(self.args.GMD)
        self.ENV = self.ds.env().configStore()
	self.PRESS = Detector(self.args.PRESS)
 def __init__(self):
     self.s2s = ShotToShotCharacterization.ShotToShotCharacterization()
     self.ds = None
     self.event_ok = False
     self.results = None
     self.current_event = None
     self.n_processed = 0
     self.n_success = 0
예제 #3
0
####################################################################
############################# STARTING ANALYSIS #####################
####################################################################

if rank == 0: print "Starting analysis on ", size, " cores."

for run in runs:

    ###### --- Offline analysis
    ds = DataSource(
        "exp=AMO/amon0816:run=%s:smd:dir=/reg/d/ffb/amo/amon0816/xtc:live" %
        run)
    #ds = DataSource("exp=AMO/amon0816:run=%s:smd" % run)

    XTCAVRetrieval = ShotToShotCharacterization()
    XTCAVRetrieval.SetEnv(ds.env())
    opal_det = Detector('OPAL1')
    #opal4_det = Detector('OPAL4')
    minitof_det = Detector('ACQ1')
    minitof_channel = 0
    ebeam_det = Detector('EBeam')
    feegas_det = Detector('FEEGasDetEnergy')
    eorbits_det = Detector('EOrbits')

    for nevt, evt in enumerate(ds.events()):
        if nevt % size != rank: continue

        ##############################  READING IN DETECTORS #############################
        ### Opal Detector
        opal_raw = opal_det.raw(evt)
 def __init__(self, name='xtcav', detname='xtcav'):
     self.name = name
     self.detname = detname
     self.nb=1
     self.size=5000
     self.ShotToShotCharacterization = Xtcav.ShotToShotCharacterization()
예제 #5
0
import psana
from xtcav.ShotToShotCharacterization import *

maxshots = 5  #Maximum number of valid shots to process
experiment = 'amoc8114'  #Experiment label
runs = '87'  #Runs

#Loading the dataset from the "dark" run, this way of working should be compatible with both xtc and hdf5 files
dataSource = psana.DataSource("exp=%s:run=%s:idx" % (experiment, runs))

#XTCAV Retrieval (setting the data source is useful to get information such as experiment name)
XTCAVRetrieval = ShotToShotCharacterization()
XTCAVRetrieval.SetDataSource(dataSource)

for r, run in enumerate(dataSource.runs()):
    n_r = 0  #Counter for the total number of xtcav images processed within the run
    times = run.times()
    for t in times:
        evt = run.event(t)

        if not XTCAVRetrieval.SetCurrentEvent(evt):
            continue

        t, power, ok1 = XTCAVRetrieval.XRayPower()
        agreement, ok2 = XTCAVRetrieval.ReconstructionAgreement()

        if (ok1 and ok2):
            print "%d/%d" % (n_r, maxshots
                             )  #Debugging purposes, will be removed
            print 'Agreement: %g %% Maximum power: %g GW' % (agreement * 100,
                                                             np.amax(power))
예제 #6
0
 def __init__(self):
     self.s2s = ShotToShotCharacterization.ShotToShotCharacterization()
     self.ds = None
     self.event_ok = False
     self.results = None