Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:50:29

0001 #!/usr/bin/env python
0002 """
0003 U4TreeCreateSSimTest.py
0004 =====================
0005 """
0006 
0007 import numpy as np, textwrap
0008 from opticks.ana.fold import Fold
0009 from opticks.sysrap.stree import stree, snode
0010 
0011 np.set_printoptions(edgeitems=16)
0012 
0013 if __name__ == '__main__':
0014     f = Fold.Load("$FOLD/SSim/stree", symbol="f")
0015     print(repr(f))
0016     snode.Fields(bi=True)  # bi:True exports field indices into builtins scope
0017 
0018     EXPR = r"""
0019     f.nds.shape
0020     snode.Label(5,6)         # field label spacing and initial offset 
0021     ri,ro                    # (repeat_index, repeat_ordinal) 
0022     f.nds[f.nds[:,ri] == 1]  # structural nodes with repeat_index of 1 
0023     snode.Label(5,6)         # field label spacing and initial offset  
0024     snode.Doc()
0025     """
0026 
0027     for expr in list(filter(None,textwrap.dedent(EXPR).split("\n"))):
0028         print(expr)
0029         if len(expr) == 0 or expr[0] == "#": continue
0030         print(eval(expr))
0031     pass
0032 
0033 
0034 
0035 
0036