projects
/
pypiezo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b1efdf3
)
Improved plotVerbose behaviour in wiggleForInterferenceMin()
author
W. Trevor King
<wking@drexel.edu>
Thu, 8 Jan 2009 15:49:07 +0000
(10:49 -0500)
committer
W. Trevor King
<wking@drexel.edu>
Thu, 8 Jan 2009 15:49:07 +0000
(10:49 -0500)
z_piezo_utils.py
patch
|
blob
|
history
diff --git
a/z_piezo_utils.py
b/z_piezo_utils.py
index 122098bc2395c5de24972bea5111cb8e0d99a9c3..f80017fcf4c6e194c1b8ad5db9497266b9876ccf 100644
(file)
--- a/
z_piezo_utils.py
+++ b/
z_piezo_utils.py
@@
-88,9
+88,10
@@
def moveToPosOrDef(zpiezo, pos, defl, step, return_data=False) :
return zpiezo.curVals()
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"
"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
from pylab import figure, plot, title, hold, ion, ioff, draw, axes
npoints = 1000
scanfreq = wig_freq*npoints
@@
-98,25
+99,28
@@
def wiggleForInterferenceMin(zpiezo, wig_amp=20000, wig_freq=100) :
for i in range(npoints) :
out[i] = int(sin(4*pi*i/npoints)*wig_amp+32000)
# 4 for 2 periods
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")
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)
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()
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)
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"
def getSurfPosData(zpiezo, maxDefl, textVerbose=False, plotVerbose=False) :
"Measure the distance to the surface"