Skip to content

Commit

Permalink
Fix avg over other channels than 1 (#45)
Browse files Browse the repository at this point in the history
* Fix avg over other channels than 1

* typo
  • Loading branch information
jenshnielsen authored and WilliamHPNielsen committed Jun 26, 2017
1 parent 0e46af7 commit 74cd49f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qcodes/instrument_drivers/rohde_schwarz/ZNB20.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get(self):
# instrument averages over its last 'avg' number of sweeps
# need to ensure averaged result is returned
for avgcount in range(getattr(self._instrument, 'avg{}{}'.format(*self._sindex))()):
self._instrument.write('INIT:IMM; *WAI')
self._instrument.write('INIT{}:IMM; *WAI'.format(self._channel))
data_str = self._instrument.ask('CALC{}:DATA? SDAT'.format(self._channel)).split(',')
data_list = [float(v) for v in data_str]

Expand Down Expand Up @@ -134,7 +134,7 @@ def get(self):
# instrument averages over its last 'avg' number of sweeps
# need to ensure averaged result is returned
for avgcount in range(getattr(self._instrument, 'avg{}{}'.format(*self._sindex))()):
self._instrument.write('INIT:IMM; *WAI')
self._instrument.write('INIT{}:IMM; *WAI'.format(self._channel))
data_str = self._instrument.ask('CALC{}:DATA? FDAT'.format(self._channel))
data = np.array(data_str.rstrip().split(',')).astype('float64')

Expand Down

0 comments on commit 74cd49f

Please sign in to comment.