project8 / Pypeline

A python interface for the dripline slow control system.
Other
2 stars 0 forks source link

_GetSweptVoltages returns nonsense #59

Open ldeviveiros opened 10 years ago

ldeviveiros commented 10 years ago

Error message:

File "build/bdist.macosx-10.9-intel/egg/pypeline/scripts/dpph/swept_dpph_gui.py", line 180, in _CollectSweep
    magdata = magdata - mean(magdata)
  File "/Temp/project8/pypeline/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 2716, in mean
    out=out, keepdims=keepdims)
  File "/Temp/project8/pypeline/lib/python2.7/site-packages/numpy/core/_methods.py", line 62, in _mean
    ret = um.add.reduce(arr, axis=axis, dtype=dtype, out=out, keepdims=keepdims)
TypeError: cannot perform reduce with flexible type

magdata gets created in the line:

magdata = array(sweep['amplitude_curve'])

What happens is that 60% of the time, the command sweep['amplitude_curve'] returns the data, and 40% of the time it returns a message:

(u'i', u'm', u'e')

(type: 'unicode')

Right now the dpph script will run _GetSweptVoltages until it gets data back (int values); it will repeat magdata[0] is unicode.