aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2022-11-15 11:16:17 +0100
committerThéo de la Hogue2022-11-15 11:16:17 +0100
commit80a3ee0d369bbca65bb5f1ffff9489af37085aab (patch)
tree978da2e7b0317fce6dc9e7e6a335b133376c7e81 /src
parent3fcd146ef0c28907bcd45288bf3e4a0a2b2c22e1 (diff)
downloadargaze-80a3ee0d369bbca65bb5f1ffff9489af37085aab.zip
argaze-80a3ee0d369bbca65bb5f1ffff9489af37085aab.tar.gz
argaze-80a3ee0d369bbca65bb5f1ffff9489af37085aab.tar.bz2
argaze-80a3ee0d369bbca65bb5f1ffff9489af37085aab.tar.xz
Updating and renaming data plotting utils script.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/tobii_segment_data_plot_export.py (renamed from src/argaze/utils/tobii_segment_gaze_plot_export.py)19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/argaze/utils/tobii_segment_gaze_plot_export.py b/src/argaze/utils/tobii_segment_data_plot_export.py
index d28bafb..69f88e3 100644
--- a/src/argaze/utils/tobii_segment_gaze_plot_export.py
+++ b/src/argaze/utils/tobii_segment_data_plot_export.py
@@ -41,14 +41,27 @@ def main():
destination_path = args.segment_path
- data_plots_filepath = f'{destination_path}/plots.svg'
+ # Export into a dedicated time range folder
+ if args.time_range[1] != None:
+ timerange_path = f'[{int(args.time_range[0])}s - {int(args.time_range[1])}s]'
+ else:
+ timerange_path = f'[all]'
+
+ destination_path = f'{destination_path}/{timerange_path}'
+
+ if not os.path.exists(destination_path):
+
+ os.makedirs(destination_path)
+ print(f'{destination_path} folder created')
+
+ data_plots_filepath = f'{destination_path}/data_plot.svg'
# Load a tobii segment
tobii_segment = TobiiEntities.TobiiSegment(args.segment_path, int(args.time_range[0] * 1e6), int(args.time_range[1] * 1e6) if args.time_range[1] != None else None)
# Load a tobii segment video
tobii_segment_video = tobii_segment.load_video()
- print(f'Video properties:\n\tduration: {tobii_segment_video.get_duration() / 1e6} s\n\twidth: {tobii_segment_video.get_width()} px\n\theight: {tobii_segment_video.get_height()} px')
+ print(f'Video properties:\n\tduration: {tobii_segment_video.duration / 1e6} s\n\twidth: {tobii_segment_video.width} px\n\theight: {tobii_segment_video.height} px')
# Load a tobii segment data
tobii_segment_data = tobii_segment.load_data()
@@ -58,7 +71,7 @@ def main():
print(f'\t{name}: {len(tobii_segment_data[name])} data')
# Edit figure
- figure_width = min( 4 * tobii_segment_video.get_duration() / 1e6, 56) # maximal width to display: 56 inches at 144 dpi < 2^16 pixels
+ figure_width = min( 4 * tobii_segment_video.duration / 1e6, 56) # maximal width to display: 56 inches at 144 dpi < 2^16 pixels
data_sample = 8064 # 56 inches * 144 dpi = 8064 data can be displayed at max
figure = mpyplot.figure(figsize=(figure_width, 35), dpi=144)