Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:48

0001 #!/usr/bin/env python
0002 """
0003 ::
0004 
0005     ipython --pdb -i ls.py 
0006 
0007 """
0008 import numpy as np
0009 np.set_printoptions(suppress=True)
0010 from opticks.ana.material import Material
0011 import matplotlib.pyplot as plt
0012 
0013 if __name__ == '__main__':
0014 
0015     matname = "LS"
0016     #matname = "Pyrex"
0017     #matname = "Air"
0018     #matname = "Water"
0019     mat = Material(matname)
0020     tab = mat.table("FINE_DOMAIN").reshape(-1,6)
0021     qwn = mat.table_qwn()
0022 
0023     #print(mat.hdr())
0024     #print(tab)
0025     
0026     print("".join(list(map(lambda _:" %10s " % _, qwn))))
0027  
0028     fmt = " %10.3f " * 6
0029     for row in tab:
0030         print( fmt % tuple(row) )
0031     pass
0032     #print(tab.shape)
0033 
0034     fig, axs = plt.subplots(2,1)  
0035     fig.suptitle(matname)
0036 
0037     ax = axs[0]
0038     ax.plot( tab[:,0], tab[:,1], label=qwn[1] )
0039     ax.plot( tab[:,0], tab[:,4], label=qwn[4] )
0040     ax.plot( tab[:,0], tab[:,5]/300., label="%s/300" % qwn[5] )
0041     ax.legend()
0042 
0043     ax = axs[1]
0044     ax.plot( tab[:,0], tab[:,2], label=qwn[2] )
0045     ax.plot( tab[:,0], tab[:,3], label=qwn[3] )
0046     ax.legend()
0047 
0048     fig.show()
0049