demo/aout: support also samples with only one channel
[pycomedi.git] / .be / b89928f6-6d46-4a1e-94b3-a9e8c13d2078 / bugs / 88a58ed8-0fd9-4963-adb0-dcf6b842f2cc / comments / a02dd6cc-132c-438a-96b2-f3677673bdfe / body
1 In [31]: for i in range(10) :
2     for nmPsRate in rates :
3         u.unfold(nmPsRate=nmPsRate, rel_setpoint=1, nmDist=800, sBindTime=4)
4         u.xpWander()
5    ....:         
6    ....:         
7 setpoint = 0.846952
8 approaching
9 0.846952010376 <type 'float'>
10 0.846952010376 <type 'float'>
11 None <type 'NoneType'>
12 ---------------------------------------------------------------------------
13 <type 'exceptions.TypeError'>             Traceback (most recent call last)
14
15 /thor/mroman/<ipython console> in <module>()
16
17 /home/wking/.python/unfold.py in unfold(self, setpoint, rel_setpoint, sBindTime, nmDist, nmStep, ppStep, nmPsRate, dataDirectory, fileID)
18     116             except ExceptionTooFar :
19     117                 try : # try for a useful surface distance...
20 --> 118                     surfPos = self.getSurfPos(setpoint)
21     119                     print "Too far (surface at %g nm), stepping closer" % surfPos
22     120                 except z_piezo_utils.poorFit, string : # ... oh well, print what we know
23
24 /home/wking/.python/unfold.py in getSurfPos(self, setpoint, textVerbose, plotVerbose)
25     266         return out
26     267     def getSurfPos(self, setpoint=2, textVerbose=False, plotVerbose=False) :
27 --> 268         return self.zp.pos_out2nm(z_piezo_utils.getSurfPos(self.zp, self.zp.def_V2in(setpoint), textVerbose, plotVerbose))
28     269     def curDef(self) :
29     270         self.zp.updateInputs()
30
31 /home/wking/.python/z_piezo.py in def_V2in(self, physical)
32     139     def def_V2in(self, physical) :
33     140         print physical, type(physical) # temporary debugging printout
34 --> 141         return self._jump.phys_to_out(physical)
35     142     def curVals(self) :
36     143         return {'Z piezo output': self.curPos(),
37
38 /home/wking/.python/z_piezo.py in phys_to_out(self, physical)
39     254         return self.AO.comedi_to_phys(0, output)
40     255     def phys_to_out(self, physical) :
41 --> 256         return self.AO.phys_to_comedi(0, physical)
42     257 
43     258 class _z_piezo_ramp :
44
45 /thor/wking/lib/python2.5/site-packages/pycomedi-0.1-py2.5.egg/pycomedi/common.py in phys_to_comedi(self, chan_index, phys)
46     362         return phys
47     363     def phys_to_comedi(self, chan_index, phys) :
48 --> 364         comedi = self._comedi.comedi_from_phys(phys, self._comedi_range[chan_index], self.maxdata[chan_index])
49     365         if self.verbose :
50     366             print "%g Volts = comedi %d on subdev %d, chan %d, range [%g, %g], max %d" % (phys, comedi, self.subdev, self.chan[chan_index], self._comedi_range[chan_index].max, self._comedi_range[chan_index].min, self.maxdata[chan_index])
51
52 <type 'exceptions.TypeError'>: in method 'comedi_from_phys', argument 1 of type 'double'
53
54 In [35]: 
55