return zpiezo.curVals()
-def wiggleForInterferenceMin(zpiezo, wig_amp=20000, wig_freq=100) :
+def wiggleForInterferenceMin(zpiezo, wig_amp=20000, wig_freq=100,
+ plotVerbose=True) :
"Output sin to measure interference"
- if not PYLAB_INTERACTIVE_VERBOSE :
+ if PYLAB_INTERACTIVE_VERBOSE or plotVerbose:
from pylab import figure, plot, title, hold, ion, ioff, draw, axes
npoints = 1000
scanfreq = wig_freq*npoints
for i in range(npoints) :
out[i] = int(sin(4*pi*i/npoints)*wig_amp+32000)
# 4 for 2 periods
- figure(BASE_FIG_NUM+1)
- a = axes()
+ if PYLAB_INTERACTIVE_VERBOSE or plotVerbose:
+ figure(BASE_FIG_NUM+1)
+ a = axes()
+ title('wiggle for interference')
+ hold(False)
+ p = plot(out, out, 'b.-')
if LOG_DATA :
log = data_logger.data_log(LOG_DIR, noclobber_logsubdir=False,
log_name="wiggle")
- title('wiggle for interference')
- hold(False)
- p = plot(out, out, 'b.-')
c = curses_check_for_keypress.check_for_keypress(test_mode=False)
while c.input() == None :
data = zpiezo.ramp(out, scanfreq)
- p[0].set_ydata(data["Deflection input"])
dmin = data["Deflection input"].min()
dmax = data["Deflection input"].max()
- a.set_ylim([dmin,dmax])
+ if PYLAB_INTERACTIVE_VERBOSE or plotVerbose:
+ p[0].set_ydata(data["Deflection input"])
+ a.set_ylim([dmin,dmax])
+ draw()
if LOG_DATA :
log.write_dict_of_arrays(data)
- draw()
- hold(True)
+ if PYLAB_INTERACTIVE_VERBOSE or plotVerbose:
+ hold(True)
def getSurfPosData(zpiezo, maxDefl, textVerbose=False, plotVerbose=False) :
"Measure the distance to the surface"