Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:06

0001 #!/usr/bin/env python
0002 
0003 import os, numpy as np
0004 from opticks.ana.fold import Fold
0005 from opticks.ana.pvplt import *
0006 import pyvista as pv
0007 COLORS = "cyan red green blue cyan magenta yellow pink orange purple lightgreen".split()
0008 
0009 
0010 if __name__ == '__main__':
0011     t = Fold.Load(symbol="t")
0012     print(repr(t))
0013 
0014     pp = t.pp
0015 
0016     os.environ["EYE"] = "-0.707,-100,0.707"
0017     os.environ["LOOK"] = "-0.707,0,0.707"
0018 
0019     label = "qsim_test.py "
0020     pl = pvplt_plotter(label=label)   
0021 
0022     lim = slice(None)
0023 
0024     mom0 = pp[:,0,1,:3]
0025     pol0 = pp[:,0,2,:3]
0026 
0027     mom1 = pp[:,1,1,:3]
0028     pol1 = pp[:,1,2,:3]
0029 
0030     pp[:,0,0,:3] = -mom0    # illustrative choice incident position on unit hemisphere
0031     pp[:,1,0,:3] = [0,0,0]  # illustrative choice transmitted position on unit hemisphere
0032 
0033 
0034     pvplt_viewpoint( pl ) 
0035 
0036 
0037     ii = [0,4,8,12]        # looks like the S-pol survives unscathed, but P-pol gets folded over
0038 
0039     ii = list(range(len(pp)))  
0040     
0041 
0042     for i in ii:
0043         polcol = COLORS[ i % len(COLORS)]
0044         pvplt_photon( pl, pp[i:i+1,0], polcol=polcol, polscale=0.5 )
0045         pvplt_photon( pl, pp[i:i+1,1], polcol=polcol, polscale=0.5 )
0046     pass
0047 
0048     cp = pl.show() 
0049     
0050 
0051     
0052