Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #!/usr/bin/env python
0002 """
0003 ::
0004 
0005     ipython --pdb -i abplt.py 
0006 
0007 """
0008 import numpy as np
0009 from opticks.ana.ab import AB 
0010 from opticks.ana.main import opticks_main
0011 
0012 import matplotlib.pyplot as plt
0013 np.set_printoptions(suppress=True)
0014 
0015 qbins={}
0016 qbins["wl"]=np.arange(300,600,5)
0017 qbins["w0"]=np.arange(300,600,5)
0018 qbins["t"] = np.arange(0, 300, 5) 
0019 qbins["r"] = np.arange(0, 20100, 100) 
0020 
0021 if __name__ == '__main__':
0022     ok = opticks_main()
0023     ab = AB(ok)  
0024     a = ab.a
0025     b = ab.b
0026 
0027     qq="w0 wl r t"
0028     #qq="w0"
0029 
0030     for q in qq.split():
0031         bins=qbins[q]
0032 
0033         ah = np.histogram( getattr(a, q), bins=bins )[0]
0034         bh = np.histogram( getattr(b, q), bins=bins )[0] 
0035 
0036         fig, ax = plt.subplots()
0037         ax.plot( bins[:-1], ah, label="OK:%s" % q, drawstyle="steps" )
0038         ax.plot( bins[:-1], bh, label="G4:%s" % q, drawstyle="steps" )
0039         ax.legend()
0040         fig.show()
0041     pass
0042 
0043