def _calculate_zmat_values(self, construction_table):
c_table = construction_table
if not isinstance(c_table, pd.DataFrame):
if isinstance(c_table, pd.Series):
c_table = pd.DataFrame(c_table).T
else:
c_table = np.array(c_table)
if len(c_table.shape) == 1:
c_table = c_table[None, :]
c_table = pd.DataFrame(
data=c_table[:, 1:], index=c_table[:, 0],
columns=['b', 'a', 'd'])
c_table = c_table.replace(constants.int_label).astype('i8')
c_table.index = c_table.index.astype('i8')
new_index = c_table.index.append(self.index.difference(c_table.index))
X = self.loc[new_index, ['x', 'y', 'z']].values.astype('f8').T
c_table = c_table.replace(dict(zip(new_index, range(len(self)))))
c_table = c_table.values.T
err, C = transformation.get_C(X, c_table)
if err == ERR_CODE_OK:
C[[1, 2], :] = np.rad2deg(C[[1, 2], :])
return C.T
评论列表
文章目录