Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio n. 6
0
 def plot( self ):
     gnuplot.plot( self.gnuplotL )
Esempio 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"],
Esempio n. 8
0
    def go():
        dl = datalog("homie.csv", 0, 1, 5)

        h = histogram(dl.RPM_data(), boxsize=2)
        gnuplot.plot([h])
Esempio 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])
Esempio n. 10
0
 def plot(self):
     gnuplot.plot(self.gnuplotL)
Esempio n. 11
0
 def go():
     dl =datalog("homie.csv", 0, 1, 5)
 
     h = histogram(dl.RPM_data(), boxsize=2)
     gnuplot.plot([h])
Esempio 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])