Belongs to previous commit

This commit is contained in:
Anne de Jong 2022-10-20 12:29:24 +02:00
parent 6758655eaa
commit fae1847cf8

View File

@ -251,7 +251,13 @@ class Measurement:
self._time = f.attrs['time']
# Quantity stored as channel.
self._qtys = None
try:
qtys_enum_idx = f.attrs['qtys_enum_idx']
self._qtys = [SIQtys.fromInt(idx) for idx in qtys_enum_idx]
except KeyError:
try:
qtys_json = f.attrs['qtys']
# Load quantity data
@ -261,18 +267,11 @@ class Measurement:
# measurement file.
pass
try:
qtys_enum_idx = f.attrs['qtys_enum_idx']
self._qtys = [SIQtys.fromInt(idx) for idx in qtys_enum_idx]
except KeyError:
pass
if self._qtys is None:
self._qtys = [SIQtys.default() for i in range(self.nchannels)]
logging.debug(f'Physical quantity data not available in measurement file. Assuming {SIQtys.default}')
logging.debug(f'Physical quantity data not available in measurement file. Assuming {SIQtys.default}')
def setAttribute(self, atrname, value):
"""
Set an attribute in the measurement file, and keep a local copy in