Belongs to previous commit
This commit is contained in:
parent
6758655eaa
commit
fae1847cf8
@ -251,28 +251,27 @@ class Measurement:
|
|||||||
|
|
||||||
self._time = f.attrs['time']
|
self._time = f.attrs['time']
|
||||||
|
|
||||||
|
# Quantity stored as channel.
|
||||||
self._qtys = None
|
self._qtys = None
|
||||||
try:
|
|
||||||
qtys_json = f.attrs['qtys']
|
|
||||||
# Load quantity data
|
|
||||||
self._qtys = [Qty.from_json(qty_json) for qty_json in qtys_json]
|
|
||||||
except KeyError:
|
|
||||||
# If quantity data is not available, this is an 'old'
|
|
||||||
# measurement file.
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
qtys_enum_idx = f.attrs['qtys_enum_idx']
|
qtys_enum_idx = f.attrs['qtys_enum_idx']
|
||||||
self._qtys = [SIQtys.fromInt(idx) for idx in qtys_enum_idx]
|
self._qtys = [SIQtys.fromInt(idx) for idx in qtys_enum_idx]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
try:
|
||||||
|
qtys_json = f.attrs['qtys']
|
||||||
|
# Load quantity data
|
||||||
|
self._qtys = [Qty.from_json(qty_json) for qty_json in qtys_json]
|
||||||
|
except KeyError:
|
||||||
|
# If quantity data is not available, this is an 'old'
|
||||||
|
# measurement file.
|
||||||
|
pass
|
||||||
|
|
||||||
if self._qtys is None:
|
if self._qtys is None:
|
||||||
self._qtys = [SIQtys.default() for i in range(self.nchannels)]
|
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}')
|
||||||
|
|
||||||
|
|
||||||
logging.debug(f'Physical quantity data not available in measurement file. Assuming {SIQtys.default}')
|
|
||||||
def setAttribute(self, atrname, value):
|
def setAttribute(self, atrname, value):
|
||||||
"""
|
"""
|
||||||
Set an attribute in the measurement file, and keep a local copy in
|
Set an attribute in the measurement file, and keep a local copy in
|
||||||
|
Loading…
Reference in New Issue
Block a user