labrad / servers

LabRAD servers
24 stars 21 forks source link

Infiniium server unit error #416

Closed rb25 closed 7 years ago

rb25 commented 7 years ago

Trying to run dac_cal.calibrate, running into unit error.


In [5]: dcal.calibrate_dc_pulse_infiniium(cxn, 'leadbetter DACer 10', 0, 0)
scope reset
scope packet sent
10 MHz ref: INT
Measuring step response...
---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-5-8f126e5eaac9> in <module>()
----> 1 dcal.calibrate_dc_pulse_infiniium(cxn, 'leadbetter DACer 10', 0, 0)

/usr/local/google/home/barends/src/pyle/dac_cal/calibrate.py in calibrate_dc_pulse_infiniium(cxn, boardname, channel, conf_10_MHz, wait_s, baseline, pulse_height, num_avgs)
    570         time.sleep(wait_s)
    571 
--> 572     t, y = scope.get_trace(SCOPECHANNEL_infiniium)  # start and stop in ns
    573 
    574     # Truncate data before t=0

/usr/local/google/home/barends/.virtualenvs/pyle/local/lib/python2.7/site-packages/labrad/client.pyc in __call__(self, *args, **kw)
     63                           "Use setting.future(...) instead.")
     64         f = self.future(*args, **kw)
---> 65         return f.result() if wait else f
     66 
     67     def future(self, *args, **kw):

/usr/local/google/home/barends/.virtualenvs/pyle/local/lib/python2.7/site-packages/concurrent/futures/_base.pyc in result(self, timeout)
    427                 raise CancelledError()
    428             elif self._state == FINISHED:
--> 429                 return self.__get_result()
    430             else:
    431                 raise TimeoutError()

/usr/local/google/home/barends/.virtualenvs/pyle/local/lib/python2.7/site-packages/concurrent/futures/_base.pyc in __get_result(self)
    379             else:
    380                 exception_type = type(self._exception)
--> 381             raise exception_type, self._exception, self._traceback
    382         else:
    383             return self._result

Error: (0) [Agilent Infiniium Oscilloscope] Remote Traceback (most recent call last):
  File "/usr/local/labrad/pylabrad/labrad/server.py", line 246, in request_handler
    result = yield self._dispatch(setting.handleRequest, self, c.data, flat_data)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "agilent_infiniium_scope.py", line 313, in get_trace
    preamble_dict = _parsePreamble(preamble)
  File "agilent_infiniium_scope.py", line 355, in _parsePreamble
    preamble_dict['xUnit'] = unit_type(preamble_dict['xUnits'])
  File "agilent_infiniium_scope.py", line 354, in unit_type
    raise Exception('Units not time or voltage')
exceptions.Exception: Units not time or voltage
 [payload=None]

In [6]: 
rb25 commented 7 years ago

Hey Brooks, if I bypass the dac_cal, and just run scope.reset() and then t,y = scope.get_trace(1) I get another type of unit error:



In [12]: scope.reset()

In [13]: t, y = scope.get_trace(1)
---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-13-cff87653ae86> in <module>()
----> 1 t, y = scope.get_trace(1)

/usr/local/google/home/barends/.virtualenvs/pyle/local/lib/python2.7/site-packages/labrad/client.pyc in __call__(self, *args, **kw)
     63                           "Use setting.future(...) instead.")
     64         f = self.future(*args, **kw)
---> 65         return f.result() if wait else f
     66 
     67     def future(self, *args, **kw):

/usr/local/google/home/barends/.virtualenvs/pyle/local/lib/python2.7/site-packages/concurrent/futures/_base.pyc in result(self, timeout)
    427                 raise CancelledError()
    428             elif self._state == FINISHED:
--> 429                 return self.__get_result()
    430             else:
    431                 raise TimeoutError()

/usr/local/google/home/barends/.virtualenvs/pyle/local/lib/python2.7/site-packages/concurrent/futures/_base.pyc in __get_result(self)
    379             else:
    380                 exception_type = type(self._exception)
--> 381             raise exception_type, self._exception, self._traceback
    382         else:
    383             return self._result

Error: (12345) Could not flatten (ValueArray(array([-499.99725952, -499.97225952, -499.94725952, ...,  499.97774048,
        500.00274048,  500.02774048]), 'ns'), ValueArray(array([-0.03055391, -0.01948842, -0.00947679, ...,  0.0469045 ,
        0.02951588,  0.03162359]), 'V')) to (*v[ns]*v[V]).
Setting ID 201. [payload=None]
rb25 commented 7 years ago

It was pylabrad all along... Thanks!