SpeedMonitor class

Monitor the mouse/finger instantaneous speed

Methods and properties:

class trajtracker.movement.SpeedMonitor(calculation_interval)
__init__(calculation_interval)

Constructor - invoked when you create a new object by writing SpeedMonitor()

Parameters:calculation_interval – See calculation_interval
calculation_interval

The time interval (in seconds) over which calculations are performed. Use shorter time period if available

last_calculation_interval

The time interval (sec) used for the last calculation of speed & direction

log_level

Logging level of this object: trajtracker.log_none, log_error (default), log_warn, log_info, log_debug, log_trace

reset(time=None)

Called when a trial starts - reset any previous movement

Parameters:time – The time when the trial starts.
stopped_duration

If the finger is stopped, this tells you for how long it’s been so. If the finger is moving, or didn’t start moving yet, this will return 0.

time_in_trial

Time elapsed since trial started (sec)

update_xyt(position, time_in_trial, time_in_session=None)

Call this method whenever the finger/mouse moves

Parameters:
  • time_in_trial – use the same time scale provided to reset()
  • time_in_session – ignored
xspeed

The instantaneous X speed (coords/sec)

xyspeed

The instantaneous speed (coords/sec) - for this calculation we consider the full distance traveled by the mouse/finger

yspeed

The instantaneous Y speed (coords/sec)