Example #1
0
    return True


xtc_dir = "/global/cscratch1/sd/monarin/d/psdm/cxi/cxid9114/xtc2"

comm.Barrier()
t_st = MPI.Wtime()
ds = DataSource('exp=xpptut13:run=1:dir=%s' % (xtc_dir),
                filter=filter,
                batch_size=100)

#print("PROFILE_GOT_DS")

det = None
if ds.nodetype == "bd":
    det = ds.Detector("CxiDs2")
    #print("PROFILE_GOT_DET")

for run in ds.runs():
    t_evt_0 = time.time()
    for i, evt in enumerate(run.events()):
        #print("PROFILE_GOT_1_EVT %d"%i)
        t_evt_st = time.time()
        if det:
            raw = det.raw(evt)
            #if raw is None:
#   print("PROFILE_GOT_NONE_RAW")
        t_evt_en = time.time()
        #print("PROFILE_EVT %d %f"%(i, t_evt_st - t_evt_0))
        t_evt_0 = time.time()
Example #2
0
# NOTE:
# This example only works with psana2-python2.7 environment

import os
from psana import DataSource


def filter(evt):
    return True


os.environ[
    'PS_CALIB_DIR'] = "/reg/d/psdm/cxi/cxid9114/scratch/mona/l2/psana-nersc/demo18/input"
xtc_dir = "/reg/d/psdm/xpp/xpptut15/scratch/mona/cxid9114"
ds = DataSource('exp=xpptut13:run=1:dir=%s' % (xtc_dir), filter=filter)
det = None
if ds.nodetype == "bd":
    det = ds.Detector("DsdCsPad")

for run in ds.runs():
    for evt in run.events():
        if det:
            raw = det.raw(evt)
            ped = det.pedestals(run)
            gain_mask = det.gain_mask(run, gain=6.85)
            print(raw.shape, ped.shape, gain_mask.shape)
Example #3
0

def filter(evt):
    return True


os.environ[
    'PS_CALIB_DIR'] = "/global/cscratch1/sd/monarin/psana-nersc/demo18/cxic0415/input"
os.environ['PS_SMD_NODES'] = '32'
os.environ['PS_SMD_N_EVENTS'] = '1000'
xtc_dir = "/global/cscratch1/sd/monarin/d/psdm/cxi/cxic0415/xtc2"
ds = DataSource('exp=cxic0415:run=50:dir=%s' % (xtc_dir),
                filter=filter,
                det_name='DscCsPad')

mylog = ""
for run in ds.runs():
    det = ds.Detector(ds.det_name)
    for evt in run.events():
        raw = det.raw(evt)
        ped = det.pedestals(run)
        gain_mask = det.gain_mask(run, gain=6.85)
        calib = det.calib(evt)
        raw_data = det.raw_data(evt)
        mylog += "%s\n" % (time.time())

with open(
        '/global/cscratch1/sd/monarin/psana-nersc/demo18/cxic0415/out/%d_debug.txt'
        % (rank), 'w') as f:
    f.write(mylog)
Example #4
0
File: det.py Project: monarin/lcls2
def det():
    ds = DataSource('data.xtc')
    det = ds.Detector('xppcspad')