Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #!/usr/bin/env python
0002 
0003 import os, numpy as np, builtins
0004 from opticks.ana.fold import Fold
0005 
0006 BASE = os.environ["BASE"]
0007 
0008 class AA(object):
0009     def __init__(self, path_=lambda i:"%d.npy" % i):
0010         symbols = "abcdefghijklmnopqrstuvwxyz" 
0011         lines = []
0012         for i in range(10):
0013             path = path_(i)
0014             if not os.path.exists(path): continue 
0015             symbol = symbols[i]
0016             a = np.load(path)
0017             setattr(builtins, symbol, a ) 
0018             msg = "symbol %s a %20s path %s " % (symbol, str(a.shape), path)
0019             lines.append(msg)
0020         pass    
0021         self.lines = lines 
0022 
0023     def __repr__(self):
0024         return "\n".join(self.lines)
0025 
0026 if __name__ == '__main__':
0027     path_ = lambda i:os.path.join(BASE, "GGeo/GMergedMesh/%d/placement_iidentity.npy" % i) 
0028     aa = AA( path_ ); 
0029     print(aa)
0030 
0031 
0032     sidx = np.concatenate( [b[:,2,3], c[:,5,3], d[:,5,3], e[:,4,3] ] )  
0033     ssidx = sidx[np.argsort(sidx)]  
0034     xsidx = np.arange( len(ssidx), dtype=np.uint32 ) 
0035     assert np.all( ssidx - 1 == xsidx )
0036 
0037 
0038     t = Fold.Load(symbol="t")
0039     print(repr(t))
0040 
0041     i = t.inst.view(np.int64) 
0042     w2 = np.where( i[:,1,3] == 2 )[0]  
0043     w3 = np.where( i[:,1,3] == 3 )[0]  
0044     w4 = np.where( i[:,1,3] == 4 )[0]  
0045     w5 = np.where( i[:,1,3] == 5 )[0]  
0046     w6 = np.where( i[:,1,3] == 6 )[0]  
0047     
0048 
0049 
0050 
0051 
0052 
0053 
0054 
0055 
0056