def __init__(self, binSize, cellMap, velocities): self.binSize = binSize self.cellMap = cellMap def index(i): return max([int(i), 0]) cells = np.empty((velocities.shape[0], 1)) for row in range(velocities.shape[0]): i, j = velocities[row, ("x", "y")] // binSize cells[row] = int(cellMap[index(i), index(j)]) self.time = velocities.time # skipping VelocityMatrix init columns = velocities.columns + ["cell"] newArray = np.append(velocities.array, cells, 1) MatrixWrapper.__init__(self, columns, newArray)
def append(self, time, x, y, angle, area): if time > self._prevTime: self._prevTime = time self.frameStarts.append(self._count) MatrixWrapper.append(self, time, x, y, angle, area)
def __init__(self): columns = ["time", "x", "y", "angle", "area"] MatrixWrapper.__init__(self, columns) self._prevTime = -1.0e99 self.frameStarts = []
def __init__(self, time): self.time = time columns = ["x", "y", "vx", "vy", "angle"] MatrixWrapper.__init__(self, columns)
def __init__(self, tracks): columns = ["x", "y", "angle", "area", "time", "id"] MatrixWrapper.__init__(self, columns, tracks)