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

Avoid overwritting by copying motion vec

parent 1ca53c59
No related branches found
No related tags found
No related merge requests found
......@@ -41,9 +41,9 @@ def next_pos(motion_vec, move_mode, move_param=None):
names=['position',
'orientation'])
speed = pd.Series(index=index)
speed['location']['dx'] = motion_vec['location']['dx']
speed['location']['dy'] = motion_vec['location']['dy']
speed['location']['dz'] = motion_vec['location']['dz']
speed.loc[('location', 'dx')] = motion_vec[('location', 'dx')]
speed.loc[('location', 'dy')] = motion_vec[('location', 'dy')]
speed.loc[('location', 'dz')] = motion_vec[('location', 'dz')]
# speed = motion_vec.loc[['dx', 'dy', 'dz']]
if move_mode == 'on_cubic_grid':
# speed in spherical coord
......@@ -87,7 +87,7 @@ def next_pos(motion_vec, move_mode, move_param=None):
# scaling = 1 # <=> dt = 1, user need to scale speed in dt units
else:
raise ValueError('grid_mode is not supported')
toreturn = motion_vec
toreturn = motion_vec.copy()
toreturn.loc[('location', 'x')] += speed['location']['dx']
toreturn.loc[('location', 'y')] += speed['location']['dy']
toreturn.loc[('location', 'z')] += speed['location']['dz']
......
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