Skip to content
Snippets Groups Projects
Commit 576f3d35 authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Move columns for posorient and vel in trajectories

parent 3b8a0ac3
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,7 @@ class DataBase():
WHERE (rowid=?)
""".format(tablename), (rowid,))
self.__viewing_dir = self.db_cursor.fetchone()[0]
self.__viewing_dir = np.round(self.__viewing_dir, decimals=3)
return self.__viewing_dir.copy()
@viewing_directions.setter
......
......@@ -2,8 +2,8 @@ import unittest
from navipy.processing import mcode
import pandas as pd
import numpy as np
from navipy.moving.agent import posorient_columns
from navipy.moving.agent import velocities_columns
from navipy.trajectories import posorient_columns
from navipy.trajectories import velocities_columns
from navipy.scene import __spherical_indeces__
......
......@@ -20,9 +20,30 @@ from scipy.interpolate import CubicSpline
import warnings
def posorient_columns(convention):
toreturn = [('location', 'x'),
('location', 'y'),
('location', 'z')]
if convention == 'quaternion':
for a in range(4):
toreturn.append((convention, 'q_{}'.format(a)))
else:
for a in range(3):
toreturn.append((convention, 'alpha_{}'.format(a)))
return toreturn
def velocities_columns(convention):
toreturn = []
# Prepend d on dimention for derivative
for it1, it2 in posorient_columns(convention):
toreturn.append((it1, 'd'+it2))
return toreturn
def _markers2position(x, kwargs):
mark0 = pd.Series(x[:3], index=['x', 'y', 'z'])
mark1 = pd.Series(x[3:6], index=['x', 'y', 'z'])
mark0 = pd.Series(x[: 3], index=['x', 'y', 'z'])
mark1 = pd.Series(x[3: 6], index=['x', 'y', 'z'])
mark2 = pd.Series(x[6:], index=['x', 'y', 'z'])
triangle_mode = kwargs['triangle_mode']
euler_axes = kwargs['euler_axes']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment