Example #1
0
def drawpic(trig):
    timedata=np.fromstring(''.join(open('%s.time'%trig,'r').read().splitlines()),sep=' ')
    fig,axes=plt.subplots(2,1,figsize=(9,6))
    axes[0].hist(timedata/1000000,bins=64,color='blue',histtype='step',label='64ms')
    axes[0].set_title('%s'%trig)
    axes[0].set_xlabel('Time/second')
    axes[0].set_ylabel('Count')
    axes[0].legend(loc='best')
    axes[1].hist(timedata/1000000,bins=1000,color='blue',histtype='step',normed='True',label='bins=1s')
    bbhist(timedata/1000000,bins='blocks',color='red',histtype='step',normed='True',label='bayesian')
    axes[1].legend(loc='best')
    axes[1].set_title('Bayesian block&1s')
    axes[1].set_xlabel('Time/second')
    axes[1].set_ylabel('Count Rate($s^{-1}$)')
    axes[1].set_ylim([0,4])
    fig.tight_layout()
    fig.savefig('%s.png'%trig,dpi=200)
Example #2
0
# total data

# <codecell>

#We use standard histogram as background, then Knuth bins & Bayesian block
fig,axes = plt.subplots(2,1,figsize=(12,6))

axes[0].hist(timedata/1000,bins=64,color='blue',histtype='step',label='64ms')
axes[0].set_title('bins=64')
axes[0].set_xlabel('Time/second')
axes[0].set_ylabel('Count')
axes[0].legend(loc='best')


axes[1].hist(timedata/1000,bins=1000,color='blue',histtype='step',normed='True',label='bins=1s')
bbhist(timedata/1000,bins='blocks',color='red',histtype='step',normed='True',label='bayesian')
axes[1].legend(loc='best')
axes[1].set_title('Bayesian block')
axes[1].set_xlabel('Time/second')
axes[1].set_ylabel('Count Rate($s^{-1}$)')
#axes[1].set_ylim([0,0.001])

fig.tight_layout()
fig.savefig('%s.png'%trig,dpi=200)


# <headingcell level=2>

# Channel data

# <headingcell level=3>