예제 #1
0
    def get(self, start, interval=None, step=1):
        start, interval = data._prepare(start, interval)

        x_vals = data.timerange(start, interval, step)
        y_vals = self.interp(start, interval, step)

        try:
            return zip(x_vals.tolist(), y_vals.tolist())
        except TypeError, ValueError:
            return zip(x_vals.tolist(), [None] * len(x_vals))
예제 #2
0
	def get (self, start, interval = None, step = 1):
		start, interval = data._prepare(start, interval)

		x_vals = data.timerange(start, interval, step)
		y_vals = self.interp(start, interval, step)

		try:
			return zip(x_vals.tolist(), y_vals.tolist())
		except TypeError, ValueError:
			return zip(x_vals.tolist(), [None] * len(x_vals))
예제 #3
0
	def get (self, start, interval, step):
		
		new_x = data.timerange(start, interval, step)

		# Get the slice of y according to frame.
		# Need to use raw data
		# TODO: make all manupulations use raw data!
		x = self._expr._x
		y = self._expr._y
		
		if len(y) > self._window_len:
			# Extend the slice so that the window can be applied to the edges.
			s = np.r_[y[self._window_len-1:0:-1], y, y[-1:-self._window_len:-1]]

			y_smooth = np.convolve(self._window, s, mode = 'valid')
			y = y_smooth[self._half_window_len : len(y_smooth) - self._half_window_len]
			
		return np.interp(new_x, x, y)
예제 #4
0
    def get(self, start, interval, step):

        new_x = data.timerange(start, interval, step)

        # Get the slice of y according to frame.
        # Need to use raw data
        # TODO: make all manupulations use raw data!
        x = self._expr._x
        y = self._expr._y

        if len(y) > self._window_len:
            # Extend the slice so that the window can be applied to the edges.
            s = np.r_[y[self._window_len - 1:0:-1], y,
                      y[-1:-self._window_len:-1]]

            y_smooth = np.convolve(self._window, s, mode='valid')
            y = y_smooth[self._half_window_len:len(y_smooth) -
                         self._half_window_len]

        return np.interp(new_x, x, y)
예제 #5
0
 def get(self, start, interval, step):
     new_x = data.timerange(start, interval, step)
     m = np.min(self._expr.interp(-self._frame, self._frame, step))
     return np.ones_like(new_x) * m
예제 #6
0
	def get (self, start, interval, step):
		new_x = data.timerange(start, interval, step)
		m = np.max(self._expr.interp(-self._frame, self._frame, step))
		return np.ones_like(new_x) * m