Skip to content

Commit 2cded75

Browse files
committed
Made a more robust out of range get parser
1 parent 7ddd6b9 commit 2cded75

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

qcodes/instrument_drivers/tektronix/AWG5014.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,9 @@ def __init__(self, name, address, timeout=180, **kwargs):
339339
get_cmd=filter_cmd + '?',
340340
set_cmd=filter_cmd + ' {}',
341341
vals=vals.Enum(20e6, 100e6, 9.9e37,
342+
np.float('inf'),
342343
'INF', 'INFinity'),
343-
get_parser=self._lowpass_filter_get_parser)
344+
get_parser=self._tek_outofrange_get_parser)
344345
self.add_parameter('ch{}_DC_out'.format(i),
345346
label='DC output level channel {}'.format(i),
346347
unit='V',
@@ -395,11 +396,12 @@ def newlinestripper(self, string):
395396
else:
396397
return string
397398

398-
def _lowpass_filter_get_parser(self, string):
399-
if 'E+037\n' in string:
400-
val = 'INF'
401-
else:
402-
val = float(string)
399+
def _tek_outofrange_get_parser(self, string):
400+
val = float(string)
401+
# note that 9.9e37 is used as a generic out of range value
402+
# in tektronix instruments
403+
if val >= 9.9e37:
404+
val = np.float('INF')
403405
return val
404406

405407
# Functions

0 commit comments

Comments
 (0)