Commit 0badb2c3 authored by Niels-Oliver Walkowski's avatar Niels-Oliver Walkowski
Browse files

add func to derive frame numbers from np indices

parent 628af44f
......@@ -98,6 +98,12 @@ class View(np.ndarray):
return cls
def frms_from_indcs(self, indices):
"""results frame numbers from a list of indices"""
indices = np.add(indices, 1)
frm_nrs = np.multiply(indices, self._frame_step)
frm_nrs = np.subtract(frm_nrs, self._frame_step)
return frm_nrs.flatten()
# subclassing subclass of numpy http://stackoverflow.com/questions/7342637/how-to-subclass-a-subclass-of-numpy-ndarray
# TODO es gibt noch das Problem, dass numpy nach mehreren Berechnungen von drive eine max recursion Warnung ausgiebt, warum? Brauche ich __del__
......
......@@ -78,7 +78,7 @@ class SequencePlot(object):
# TODO self._x sollte eine array sein
def _vlines(self, view, mark, mark_gt, mark_lt):
npx = np..array(self._x)
npx = np.array(self._x)
if mark_gt:
poss = npx[view > mark_gt]
for pos in poss:
......
......@@ -7,14 +7,14 @@ from itten.visuals import UnivariatePlot
movie = Movie(prefix='wwz_', folder='../DHd-2017/Data/Frames/WWZ/')
# movie._frames.start = 367
# movie._frames.end = 1000
cont = MultivariateSequence(movie._frames,)
# cont = UnivariateSequence(movie._frames,)
cont.populate(frm_stp=3, ctrst='light_dark')
viz = MultivariatePlot(cont)
viz.plot(cont, mark=[243, 1885, 3430, 4237, 4543])
# cont = MultivariateSequence(movie._frames,)
cont = UnivariateSequence(movie._frames,)
cont.seqvar(frm_stp=10, ctrst='light_dark')
# viz = MultivariatePlot(cont)
# viz.plot(cont, mark=[243, 1885, 3430, 4237, 4543])
# cont.seqper(frm_stp=5, ctrst='saturation', perc=50)
# viz.plot(cont)
viz.saveplt('testplot_vline')
# viz.saveplt('testplot_vline')
# viz = MultivariatePlot()
# fig, ax = viz.plot(cont)
Markdown is supported
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