Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepython
titlemyrel/mypkg/src/mymod.py
linenumberstrue
collapsetrue
import psana

class mymod(object):
    def __init__(self):
        self.threshold = self.configInt('threshold',176000000)
        srcStrself.source = self.configStrconfigSrc('source','DetInfo(CxiDs1.0:Cspad.0)')
        self.source = psana.Source(srcStr)

    def event(self, evt, env):
        image = evt.get(psana.ndarray_int16_2, 
                        self.source, 
                        'image')
	    if image is None: return
        photonCount = image[:].sum()
        if photonCount < self.threshold:
            self.skip()

...