From: W. Trevor King Date: Sat, 19 Jan 2013 03:54:49 +0000 (-0500) Subject: afm: Optionally return stepper_approach data with `record_data` X-Git-Tag: v0.5~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=32bfbf98d79c73eba50b77d0917df100e0e33bcf;p=pyafm.git afm: Optionally return stepper_approach data with `record_data` Sometimes these approach curves are pretty funky, so I'll start recording them by default in calibcant-calibrate.py. --- diff --git a/pyafm/afm.py b/pyafm/afm.py index 60741c6..e76b118 100644 --- a/pyafm/afm.py +++ b/pyafm/afm.py @@ -460,10 +460,11 @@ class AFM (object): _LOG.warn(e) raise e - def stepper_approach(self, target_deflection): + def stepper_approach(self, target_deflection, record_data=None): _LOG.info('approach with stepper until deflection > {}'.format( target_deflection)) - record_data = _package_config['matplotlib'] + if record_data is None: + record_data = _package_config['matplotlib'] if record_data: position = [] deflection = [] @@ -490,6 +491,8 @@ class AFM (object): figure.show() if not _matplotlib.is_interactive(): _matplotlib_pyplot.show() + if record_data: + return (position, deflection) def move_toward_surface(self, distance): """Step in approximately `distance` meters.