From 57eb7bcba750ed011d21e757b3851793a886bfec Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 14 Mar 2012 15:16:00 -0400 Subject: [PATCH] If neither the wavelength or amplitude are given for wiggling, use half the max. --- pypiezo/afm.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pypiezo/afm.py b/pypiezo/afm.py index f19ee39..21d0186 100644 --- a/pypiezo/afm.py +++ b/pypiezo/afm.py @@ -321,10 +321,13 @@ class AFMPiezo (_base.Piezo): max_amplitude = int(maxdata-offset) offset_meters = _base.convert_bits_to_meters( output_axis.config, offset) - bit_wavelength = _base.convert_meters_to_bits( - output_axis.config, offset_meters + laser_wavelength - ) - offset - amplitude = 2*bit_wavelength + if laser_wavelength is None: + amplitude = 0.5*max_amplitude + else: + bit_wavelength = _base.convert_meters_to_bits( + output_axis.config, offset_meters + laser_wavelength + ) - offset + amplitude = 2*bit_wavelength log_string = ( 'generated amplitude for interference wiggle: %g' % amplitude) -- 2.26.2