Exemplo n.º 1
0
    def gnuplot(self, cmd=arch.GNUPLOT_CMD, terminal=arch.GNUPLOT_TERMINAL, output=arch.GNUPLOT_OUTPUT, title=None):
        """Plot rpm vs. torque and rpm vs. power using gnuplot.

        Optional arguments are:
        terminal: gnuplot terminal
        output: gnuplot output
        cmd: gnuplot command

        """
        gnuplot.plot([self.torque(), self.hp()], ["Torque", "Power"], terminal, output, cmd, title=title)
Exemplo n.º 2
0
 def gnuplot_manual(self, evt = None):
     dlg = self.GnuplotDialog(self, -1)
     if dlg.ShowModal() == wx.ID_OK:
         data = []
         label= []
         for i in dlg.selected:
             data.append(self.runs[i].torque())
             data.append(self.runs[i].hp())
             label.append("Torque %d" % i)
             label.append("Power %d" % i)
         if len(data) > 0:
             gnuplot.plot(data, terminal = arch.GNUPLOT_TERMINAL,
                          output = arch.GNUPLOT_OUTPUT, labels = label)
Exemplo n.º 3
0
 def gnuplot_manual(self, evt=None):
     dlg = self.GnuplotDialog(self, -1)
     if dlg.ShowModal() == wx.ID_OK:
         data = []
         label = []
         for i in dlg.selected:
             data.append(self.runs[i].torque())
             data.append(self.runs[i].hp())
             label.append("Torque %d" % i)
             label.append("Power %d" % i)
         if len(data) > 0:
             gnuplot.plot(data,
                          terminal=arch.GNUPLOT_TERMINAL,
                          output=arch.GNUPLOT_OUTPUT,
                          labels=label)
Exemplo n.º 4
0
    def gnuplot(self,
                cmd=arch.GNUPLOT_CMD,
                terminal=arch.GNUPLOT_TERMINAL,
                output=arch.GNUPLOT_OUTPUT,
                title=None):
        """Plot rpm vs. torque and rpm vs. power using gnuplot.

        Optional arguments are:
        terminal: gnuplot terminal
        output: gnuplot output
        cmd: gnuplot command

        """
        gnuplot.plot([self.torque(), self.hp()], ["Torque", "Power"],
                     terminal,
                     output,
                     cmd,
                     title=title)
Exemplo n.º 5
0
    return points


if __name__ == "__main__":
    import random, math
    points = []
    real = []
    for i in range(1, 1000):
        p = (math.sin(i / float(50)) * 200 + i)
        real.append((i, p))
        points.append((i, p + (random.random() - 0.5) * 400))

    import gnuplot, time
    one = NNA(points)
    gnuplot.plot([points, real, one],
                 terminal="x11",
                 labels=["Raw Data", "Real Curve", "Fit Curve"],
                 output="1.png")
    time.sleep(3)
    two = box(points)
    gnuplot.plot([points, real, two],
                 terminal="x11",
                 labels=["Raw Data", "Real Curve", "Fit Curve"],
                 output="2.png")
    time.sleep(3)
    three = RunningAverage(points)
    gnuplot.plot([points, real, three],
                 terminal="x11",
                 labels=["Raw Data", "Real Curve", "Fit Curve"],
                 output="3.png")
    time.sleep(3)
    four = SavGol(points)
Exemplo n.º 6
0
 def plot( self ):
     gnuplot.plot( self.gnuplotL )
Exemplo n.º 7
0
        points.append( (data[i][0], values[i]) )
    return points

if __name__ == "__main__":
    import random, math
    points = []
    real   = []
    for i in range(1,1000):
        p = (math.sin(i/float(50)) * 200+i) 
        real.append( (i, p) )
        points.append( (i, p + (random.random()-0.5)*400 ) )

    import gnuplot, time
    one   = NNA(points)
    gnuplot.plot([points, real, one],
                 terminal = "x11",
                 labels = ["Raw Data", "Real Curve", "Fit Curve"],
                 output = "1.png");time.sleep(3)
    two   = box(points)
    gnuplot.plot([points, real, two],
                 terminal = "x11",
                 labels = ["Raw Data", "Real Curve", "Fit Curve"],
                 output = "2.png");time.sleep(3)
    three = RunningAverage(points)
    gnuplot.plot([points,real, three],
                 terminal = "x11",
                 labels = ["Raw Data", "Real Curve", "Fit Curve"],
                 output = "3.png");time.sleep(3)
    four = SavGol(points)
    gnuplot.plot([points,real, four],
                 terminal = "x11",
                 labels = ["Raw Data", "Real Curve", "Fit Curve"],
Exemplo n.º 8
0
    def go():
        dl = datalog("homie.csv", 0, 1, 5)

        h = histogram(dl.RPM_data(), boxsize=2)
        gnuplot.plot([h])
Exemplo n.º 9
0
 def histogram_plot(evt=None):
     d = data.RPM_data()
     bs = self.hist_slider.GetValue()
     h = histogram(d, boxsize=bs)
     gnuplot.plot([h])
Exemplo n.º 10
0
 def plot(self):
     gnuplot.plot(self.gnuplotL)
Exemplo n.º 11
0
 def go():
     dl =datalog("homie.csv", 0, 1, 5)
 
     h = histogram(dl.RPM_data(), boxsize=2)
     gnuplot.plot([h])
Exemplo n.º 12
0
 def histogram_plot(evt = None):
     d = data.RPM_data()
     bs = self.hist_slider.GetValue()
     h = histogram(d, boxsize = bs)
     gnuplot.plot([h])