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

turn return value of movie.analyze iinto a DataFrame

add a timestamp column before returning it
parent 20b9d64e
......@@ -2,6 +2,8 @@
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from pathlib import Path # TODO wie kann ich third-party module nach außen verstecken
import pickle
from subprocess import Popen, PIPE, STDOUT
......@@ -141,7 +143,8 @@ class Movie(object):
Returns
-------
a view object
TODO: a pandas DataFrame containing the frame number, timestamp, bin and
number of pixels contained in the bin
"""
# set movie start and end postion for the visualization
......@@ -152,8 +155,10 @@ class Movie(object):
# CTRL funktioniert start/end hier wenn ich es nicht noch einmal
# mit übergebe ?
data = views.MultivariateSequence(self._frames,)
data.populate(ctrst=ctrst, method=meth,
frm_stp=stp)
data.populate(ctrst=ctrst, method=meth, frm_stp=stp)
data = pd.DataFrame(data, columns=['frame', 'bin', 'pixels'])
data['time'] = data['frame'].apply(helpers.frame2time, fps=4)
return data
elif view in ['seqmean', 'seqmad', 'seqvar', 'seqper']:
......
......@@ -117,6 +117,12 @@ class MultivariateSequence(View):
Parameters
----------
TODO threshold : the minimum number of pixels that need to appear in
in a certain bin so that the bin will be included in the output
data. (Needs to be modifiable in relation to the total number of
pixels in the frame, that means on the frame size 240p60 etc.)
Oder Threshold ganz raus, weil das eigentlich eine Sache der
Visualisierung ist auszusortieren.
Returns
-------
......
......@@ -20,6 +20,8 @@ class SequencePlot(object):
return [nr for nr in range(view._frames.start, view._frames.end,
view._frame_step)] # um X-Achse Minuten anzeigen zu lassen
# TODO Befindet sich jetzt in helpers, kann also aus der Klasse entfernt
# werden
def _timelabels(self, val, pos):
"""counts time values for plot tickers
......
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