File indexing completed on 2026-04-09 07:48:51
0001
0002 """
0003 wl_plt.py
0004 ============
0005
0006 While using::
0007
0008 tds3gun.sh
0009
0010 Run this to plot the "a" and "b" events provided by ab.py::
0011
0012 In [3]: run wl_plt.py
0013
0014 In [4]: wl_plt(a,b)
0015
0016 In [5]: a.sel = "CK .." ## select all history categories starting "CK"
0017
0018 In [6]: b.sel = "CK .."
0019
0020 In [7]: wl_plt(a,b)
0021
0022 """
0023 import numpy as np
0024 import matplotlib.pyplot as plt
0025
0026 def wl_plt(a, b):
0027
0028 dom = np.arange(80, 800, 50)
0029
0030 ah = np.histogram( a.ox[:,2,3], dom)
0031 bh = np.histogram( b.ox[:,2,3], dom)
0032
0033 fig, ax = plt.subplots()
0034 ax.plot( dom[:-1], ah[0], label="a", drawstyle="steps-post" )
0035 ax.plot( dom[:-1], bh[0], label="b", drawstyle="steps-post" )
0036 ax.legend()
0037 fig.show()
0038
0039
0040 def wl_plt_ck(a, b):
0041 a.sel = "CK .."
0042 b.sel = "CK .."
0043 wl_plt(a, b)
0044
0045 def wl_plt_si(a, b):
0046 a.sel = "SI .."
0047 b.sel = "SI .."
0048 wl_plt(a, b)
0049
0050
0051