Exemplo n.º 1
0
            for i, ival in enumerate(const_intervals):
                part = data[key][ival[0]:ival[1]]
                ex = (data["timestamp"][ival[1]] -
                      data["timestamp"][ival[0]]) / 2
                x = data["timestamp"][ival[0]] + ex
                y = np.mean(part)
                ey = np.std(part)
                print("%.3f±%.3f %.3f %i" % (y, ey, ex, ival[1] - ival[0]))
                g4.SetPoint(i, x, y)
                g4.SetPointError(i, ex, ey)
                interval_mean.append(y)
                interval_std.append(ey)
                interval_inc.append(last_mean < y)
                last_mean = y

            g4.SetEditable(False)
            g4.SetMarkerColor(4)
            g4.SetMarkerStyle(21)
            g4.Draw("P")
            error_graphs.append(g4)

            c1.Update()

        if len(interval_std) > 0:
            print("Mean of all STD values: %0.3f" % (np.mean(interval_std)))

        #img = TImage.Create()
        #img.FromPad(c1)
        #img.WriteImage("canvas.png")

        #sort the interval values according to their mean values