def draw_slit_int(self, N, d, a, wav, choice="slits"):
        canvas = self.canvas
        x_stp = self.x_stp
        x = []
        fx = []
        for i in range(int(float(self.W) / x_stp)):
            x.append(i * x_stp - float(self.W) / 2)
            ang = math.asin((x[i]) / self.R)
            if choice == "slits":
                fx.append(self.slit_int(N, d, wav, ang))
            else:
                fx.append(self.single_int(a, wav, ang))

        graph = graphs.graph_plot(canvas, zip(x, fx))
        graph.yrange[0] = 0
        graph.xlabel = "x/m"
        graph.ylabel = "I"
        graph.axes_enabled = False
        graph.plot()
        draw.reset2(canvas, self.xu)
    def draw_slit_int(self, N, d, a, wav, choice = "slits"):
        canvas = self.canvas
        x_stp = self.x_stp
        x = []
        fx = []
        for i in range(int(float(self.W)/x_stp)):
            x.append(i*x_stp- float(self.W)/2)
            ang = math.asin((x[i] )/self.R)
            if choice =="slits":
                fx.append(self.slit_int(N,d,wav,ang))
            else:
                fx.append(self.single_int(a,wav,ang))

        graph = graphs.graph_plot(canvas,zip(x,fx))
        graph.yrange[0] = 0
        graph.xlabel = "x/m"
        graph.ylabel = "I"
        graph.axes_enabled = False
        graph.plot()
        draw.reset2(canvas, self.xu)
    def timer_tick (self, **event_args):
        canvas = self.canvas


        if self.first:
            self.cw = canvas.get_width()
            self.ch = canvas.get_height()
            cw = self.cw
            ch = self.ch

            self.graph = graphs.graph_plot(canvas, self.startvals)
            self.graph.markers_enabled = False
            if self.set_xrange != [None, None]:
                self.graph.xrange = self.set_xrange
            else:
                self.graph.xrange = [self.xran[0], self.xran[1]]
            if self.set_yrange != [None, None]:
                self.graph.yrange = self.set_yrange
            self.graph.xlabel = self.xlabel
            self.graph.ylabel = self.ylabel
            self.graph.plot(colour = "#fff", xmarker = self.xmarker, ymarker = self.ymarker)
            self.values = graphs.fill_up(self.correct_function, self.xran)
            self.first = False