def __init__(self, src, ax, label="", dims="xyz", bones=None): """ :param src: :param label: :param dims: xyz if 3D, xy if 2D bones - array of (markerA, markerB), bones that connect individual markers """ if bones is None: bones = [] self.data, self.metadata = load_qtm_data(src, multi_index=True) self.label = label self.dims = dims self.marker_names = self.metadata["marker_names"] self.frame = -1 # for moving through frames self.markers = [] for marker_name in self.marker_names: marker = Marker( ax, data=[self.data[marker_name][dim].values for dim in self.dims], name=marker_name, dims=self.dims) self.markers.append(marker) self.get_bounds() # identify
def test_multi_index(): data, _ = qualisys.load_qtm_data('example_data.txt', multi_index=True) assert data.columns.identical(pd.MultiIndex.from_product( (['RIGHT_KNEE', 'right_ankle'], ['x', 'y', 'z']), names=['marker', 'dim'] )) yield check_index, data yield check_columns, data
def test_data(): data, _ = qualisys.load_qtm_data('example_data.txt') assert set(data) == {'RIGHT_KNEE', 'right_ankle'} assert data.axes[1].dtype == 'float64' assert np.all(data.axes[2] == ['x', 'y', 'z']) for _, frame in data.iteritems(): yield check_index, frame yield check_columns, frame
def test_datetime_index_multi_index(): data, _ = qualisys.load_qtm_data('example_data.txt', multi_index=True, datetime_index=True) yield check_datetime_index, data
def test_datetime_index(): data, _ = qualisys.load_qtm_data('example_data.txt', datetime_index=True) for _, frame in data.iteritems(): yield check_datetime_index, frame