Commit eb0e7369 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

BUG: _full_pos no longer needed

parent 3719ff65
Pipeline #5316 canceled with stage
......@@ -79,7 +79,6 @@ class Tracker(object):
streampos = sp.zeros((ntrack, self.maxstep // nstore + 1, 3))
streampos[:, 0, :] = start
current_pos = start.copy()
self._full_pos = current_pos.copy()
running = sp.ones(ntrack, dtype='bool')
for idx_step in range(self.maxstep):
......@@ -107,8 +106,6 @@ class Tracker(object):
keep[nolonger_keep] = False
running[running] = keep
current_pos = current_pos[keep]
if self._full_pos.shape[0] > 1000 and running.sum() < self._full_pos.shape[0] // 2:
self._full_pos = self._full_pos[:running.sum(), :]
if not running.any():
break
return [track[(track != 0).any(-1)] for track in streampos]
......@@ -116,10 +113,8 @@ class Tracker(object):
def update_pos(self, current_pos, inverse=False):
"""Runge-Kutta RK4 update of position
"""
self._full_pos[current_pos.shape[0]:, :] = sp.nan
def normed_vec(pos):
self._full_pos[:pos.shape[0], :] = pos
vec = self.orient_func(self._full_pos)[:pos.shape[0]]
vec = self.orient_func(pos)
vec *= self.step_size / sp.sqrt(sp.sum(vec ** 2, -1)[..., None])
if inverse:
vec *= -1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment