Beispiel #1
0
bins_mid = (bins_nf[1:] + bins_nf[:-1]) / 2

fx = para[0] + para[1] * bins_mid + para[2] * bins_mid**2

img = Image_Plot(xpad=0.25, ypad=0.2)
img.subplots(1, 2)
num = img.axs[0][0].hist(mg1, bins_nf)[0]
img.axs[0][0].errorbar(bins_mid, num, xerr=fx, capsize=3)

num = img.axs[0][1].hist(mg1 - g1, bins_nf - g1)[0]
img.axs[0][1].errorbar(bins_mid - g1, num, xerr=fx, capsize=3)

for i in range(2):
    ys = img.axs[0][i].set_ylim()
    img.axs[0][i].plot([0, 0], [ys[0], ys[1]], c="gray", ls="--")
    img.set_sci_ax(0, i, 0)
    img.set_label(0, i, 0, "Num")
    img.set_label(0, i, 1, "G")
img.show_img()

# bin difference before and after PDF
bin_num = 200
num_ave_after_pdf = numpy.zeros((2, bin_num))

img = Image_Plot(xpad=0.25, ypad=0.2)
img.subplots(2, 2)

# noise free data
bound = numpy.abs(mg1).max() / 1.5
bins = numpy.linspace(-bound, bound, bin_num + 1)
bins_mid = (bins[1:] + bins[:-1]) / 2
Beispiel #2
0
                        G1_hat = datas[tag][:show_num, 0] - gh[k] * (
                            datas[tag][:show_num, 2] +
                            datas[tag][:show_num, 3])
                        img.axs[i][j].scatter(G1_hat,
                                              datas[tag][:show_num, 1],
                                              s=6,
                                              label="g1=%.3f" % gh[k])
                    else:
                        G1_hat = datas[tag][:show_num, 1] - gh[k] * (
                            datas[tag][:show_num, 2] -
                            datas[tag][:show_num, 3])
                        img.axs[i][j].scatter(G1_hat,
                                              datas[tag][:show_num, 0],
                                              s=6,
                                              label="g2=%.3f" % gh[k])
                    img.set_sci_ax(i, j, 0)
                    img.set_sci_ax(i, j, 1)

                    if xy_lock < 0:
                        ys_ = numpy.abs(img.axs[i][j].set_ylim()).max()
                        xs_ = numpy.abs(img.axs[i][j].set_xlim()).max()

                        if ys_ > xylim:
                            xylim = ys_
                        if xs_ > xylim:
                            xylim = xs_
                else:
                    tag = (i - 1) * img_col + j
                    if component_tag == 0:
                        G1_hat = datas[tag][:, 0] - gh[k] * (datas[tag][:, 2] +
                                                             datas[tag][:, 3])