00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 """High-level wrapper module for psana.
00011
00012 Typical usage::
00013
00014 from psana import *
00015
00016 setConfigFile('config-file.cfg') # optional, default is to use psana.cfg if present
00017 setOption("psana.modules", "EventKeys") # can set/change options from script
00018
00019 # define "data source" specifying experiment and run number
00020 datasrc = DataSource("exp=cxi63112:run=111")
00021
00022 # specify source device for data
00023 cam_src = Source("CxiDg4.0:Tm6740.0")
00024
00025 # loop over all events in a data source
00026 for evt in datasrc.events():
00027 frame = evt.get(Camera.FrameV1, cam_src)
00028 image = frame.data16()
00029
00030 This software was developed for the LCLS project. If you use all or
00031 part of it, please give an appropriate acknowledgment.
00032
00033 @version $Id: __init__.py 12589 2016-09-08 20:16:55Z cpo@SLAC.STANFORD.EDU $
00034
00035 @author Andy Salnikov
00036 """
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 import sys
00048
00049
00050
00051
00052
00053
00054 if sys.platform.startswith('linux'):
00055
00056
00057 import DLFCN
00058 flags = sys.getdlopenflags()
00059 sys.setdlopenflags( flags | DLFCN.RTLD_GLOBAL )
00060 import _psana
00061 sys.setdlopenflags( flags )
00062 del flags
00063 del DLFCN
00064 else:
00065 import _psana
00066 del sys
00067
00068 from datasource import DataSource, setOption, setOptions, setConfigFile
00069 from mpi_datasource import MPIDataSource
00070 from det_interface import Detector, DetNames
00071
00072
00073
00074
00075 from _psana import *
00076
00077
00078
00079
00080 from XtcInput.PyLiveAvail import LiveAvail as LiveAvail