Skip to content
Snippets Groups Projects
Commit af3604f8 authored by Merlo, Jason's avatar Merlo, Jason
Browse files

Fixed writing trajectory attribute when no ground truth exists

parent 458faa70
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ from pyratk.acquisition.mux_buffer import MuxBuffer ...@@ -12,6 +12,7 @@ from pyratk.acquisition.mux_buffer import MuxBuffer
from pyratk.acquisition.virtual_daq import VirtualDAQ from pyratk.acquisition.virtual_daq import VirtualDAQ
from pyratk.acquisition import daq # Extention of DAQ object from pyratk.acquisition import daq # Extention of DAQ object
from pyqtgraph import QtCore from pyqtgraph import QtCore
from pyratk.formatting import warning
# COMPRESSION OPTIONS # COMPRESSION OPTIONS
...@@ -131,8 +132,11 @@ class DataManager(MuxBuffer): ...@@ -131,8 +132,11 @@ class DataManager(MuxBuffer):
self.trajectory_label = ds.attrs['trajectory'].decode('utf-8') self.trajectory_label = ds.attrs['trajectory'].decode('utf-8')
# Open trajectory dataset # Open trajectory dataset
ts = self.trajectories[ds.name.split('/')[-1]] try:
self.virt_daq.load_trajectory(ts) ts = self.trajectories[ds.name.split('/')[-1]]
self.virt_daq.load_trajectory(ts)
except KeyError as e:
warning('Error loading ground-truth trajectory: {:}'.format(e))
self.set_source(self.virt_daq) self.set_source(self.virt_daq)
self.reset() self.reset()
...@@ -251,7 +255,8 @@ class DataManager(MuxBuffer): ...@@ -251,7 +255,8 @@ class DataManager(MuxBuffer):
attrs.create("daq_type", self.source.daq_type.encode('utf8')) attrs.create("daq_type", self.source.daq_type.encode('utf8'))
attrs.create("num_channels", self.source.num_channels) attrs.create("num_channels", self.source.num_channels)
attrs.create("label", labels_str.encode('utf8')) attrs.create("label", labels_str.encode('utf8'))
attrs.create("trajectory", name.encode('utf8')) if hasattr(self.source, 'trajectory_samples'):
attrs.create("trajectory", name.encode('utf8'))
if subject: if subject:
if type(subject) is str: if type(subject) is str:
subject_name = subject subject_name = subject
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment