X-Git-Url: http://git.tremily.us/?p=calibcant.git;a=blobdiff_plain;f=calibcant%2Fcalibrate.py;h=f78520ffe5ed6f4f41a7c54b4a9c61330b8f9b17;hp=10622f49b8a3df44035e1ff489cb65bdbf3c40a0;hb=a1cb5302e9049dc5cb6e2d4b0ac46baa82f14cfe;hpb=f8efb4c0ce7ee4e1ef9bc0b97fbd4ce14fd0ee25 diff --git a/calibcant/calibrate.py b/calibcant/calibrate.py index 10622f4..f78520f 100755 --- a/calibcant/calibrate.py +++ b/calibcant/calibrate.py @@ -119,17 +119,19 @@ import analyze # bump family @splittableKwargsFunction() -def bump_aquire(zpiezo, push_depth=200, npoints=1024, freq=100e3) : +def bump_aquire(zpiezo, push_depth=200, npoints=1024, push_speed=1000) : """ Ramps closer push_depth and returns to the original position. Inputs: zpiezo an opened zpiezo.zpiezo instance push_depth distance to approach, in nm npoints number points during the approach and during the retreat - freq rate at which data is aquired + push_speed piezo speed during approach and retreat, in nm/s Returns the aquired ramp data dictionary, with data in DAC/ADC bits. """ # generate the bump output + nm_per_step = float(push_depth) / npoints + freq = push_speed / nm_per_step # freq is sample frequency in Hz start_pos = zpiezo.curPos() pos_dist = zpiezo.pos_nm2out(push_depth) - zpiezo.pos_nm2out(0) close_pos = start_pos + pos_dist @@ -138,7 +140,7 @@ def bump_aquire(zpiezo, push_depth=200, npoints=1024, freq=100e3) : out = numpy.concatenate((appr, retr)) # run the bump, and measure deflection if config.TEXT_VERBOSE : - print "Bump %g nm" % push_depth + print "Bump %g nm at %g nm/s" % (push_depth, push_speed) data = zpiezo.ramp(out, freq) return data