aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/argaze/PupilAnalysis/WorkloadIndex.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/argaze/PupilAnalysis/WorkloadIndex.py b/src/argaze/PupilAnalysis/WorkloadIndex.py
index 5ed5bee..6728595 100644
--- a/src/argaze/PupilAnalysis/WorkloadIndex.py
+++ b/src/argaze/PupilAnalysis/WorkloadIndex.py
@@ -36,7 +36,13 @@ class PupilDiameterAnalyzer(PupilFeatures.PupilDiameterAnalyzer):
if ts - self.__last_ts >= self.period:
- workload_index = (self.__variations_sum / self.__variations_number) / self.reference.value
+ if self.__variations_number > 0 and self.reference.value > 0.:
+
+ workload_index = (self.__variations_sum / self.__variations_number) / self.reference.value
+
+ else:
+
+ workload_index = 0.
self.__variations_sum = abs(pupil_diameter.value - self.reference.value)
self.__variations_number = 1