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
0004 import matplotlib.pyplot as mp  
0005 SIZE = np.array([1280, 720])
0006 np.set_printoptions(precision=5)
0007 
0008 
0009 class A(np.ndarray): 
0010     @classmethod 
0011     def Load(cls, path_, symbol="a"):
0012         path = os.path.expandvars(path_)
0013         if os.path.exists(path):
0014             a = np.load(path) 
0015             r = a.view(cls)
0016             r.label = "%s:%s" % (symbol, path_)
0017         else:
0018             print("FAILED TO LOAD : %s " % path)
0019             r = None
0020         pass
0021         return r 
0022 
0023        
0024 
0025 
0026 
0027 if __name__ == '__main__':
0028 
0029     a = A.Load("$FOLD/njuffa_erfcinvf_test.npy", symbol="a")
0030     b = A.Load("/tmp/erfcinvf_Test/erfcinvf_Test_cu.npy", symbol="b")
0031     c = A.Load("/tmp/S4MTRandGaussQTest/a.npy", symbol="c")
0032 
0033     fig, ax = mp.subplots(figsize=SIZE/100.)
0034     if not a is None:ax.scatter( a[:,0], a[:,1], s=0.2, label=a.label )
0035     if not b is None:ax.scatter( b[:,0], b[:,1], s=0.2, label=b.label )
0036     if not c is None:ax.scatter( c[:,0], c[:,1], s=0.2, label=c.label )
0037     pass
0038     ax.legend()
0039     fig.show()
0040 pass
0041