Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:20

0001 #!/usr/bin/env python
0002 """
0003 
0004 """
0005 import os, sys, numpy as np
0006 from opticks.ana.input_photons import InputPhotons
0007 from opticks.ana.fold import EXPR_
0008 from opticks.ana.pvplt import *
0009 
0010 
0011 if __name__ == '__main__':
0012 
0013     path = InputPhotons.BasePath()  # sensitive to OPTICKS_INPUT_PHOTON eg RandomSpherical100_f4.npy
0014 
0015     p = np.load(path)
0016 
0017     print("path:%s p:%s" % (path, str(p.shape)) )
0018 
0019 
0020     pl = pvplt_plotter(label=path)
0021 
0022     pos = p[:,0,:3]
0023     mom = p[:,1,:3]
0024     pol = p[:,2,:3]
0025 
0026     pvplt_polarized( pl, pos, mom, pol, factor=10 )
0027 
0028     cp = pl.show()
0029 
0030     for expr in EXPR_(r"""
0031 p.shape
0032 pos.shape
0033 pos
0034 mom.shape
0035 mom
0036 pol.shape
0037 pol
0038 """):
0039         print(expr)
0040         if expr == "" or expr[0] == "#": continue
0041         print(repr(eval(expr)))
0042     pass
0043 
0044 
0045 pass
0046