Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #!/usr/bin/env python
0002 
0003 import numpy as np, textwrap
0004 from opticks.ana.fold import Fold
0005 import matplotlib.pyplot as plt
0006 SIZE = np.array([1280,720])
0007 
0008 if __name__ == '__main__':
0009     t = Fold.Load(symbol="t")
0010     print(repr(t))
0011 
0012     s = Fold.Load("$FOLD/stree", symbol="s")
0013     print(repr(s))
0014 
0015     osur = s.implicit_osur.reshape(-1,8)
0016     isur = s.implicit_isur.reshape(-1,8)
0017 
0018     mtn = np.array(s.mat_names)
0019     sun = np.array(s.sur_names)
0020     
0021 
0022     u_osur,i_osur,n_osur = np.unique(osur,axis=0,return_index=True,return_counts=True)
0023     u_isur,i_isur,n_isur = np.unique(isur,axis=0,return_index=True,return_counts=True)
0024 
0025 
0026     EXPRS = r"""
0027 
0028     osur.shape
0029     u_osur.shape
0030 
0031     isur.shape
0032     u_isur.shape
0033 
0034     np.c_[n_osur,i_osur,u_osur]
0035     np.c_[n_isur,i_isur,u_isur]
0036 
0037     """
0038     for expr in list(filter(None,textwrap.dedent(EXPRS).split("\n"))):
0039         print(expr)
0040         if expr[0] in " #": continue
0041         print(eval(expr))
0042     pass
0043 
0044 
0045