x_high = float(x[i_high])
if x_high == x_contact: # things must be pretty flat
x_contact = (x_contact + x[0]) / 2
+ if x_high == x_contact:
+ x_high = x[1]
slope = (y_high - y_contact) / (x_high - x_contact)
return (x_contact, y_contact, slope)
except ValueError:
zd = _numpy.ndarray(list(z.shape) + [2], dtype=z.dtype)
zd[:,0] = z
- zd[:,1] = d
+ zd[:,1] = deflection
_numpy.savetxt('/tmp/z-deflection.dat', zd, delimiter='\t')
raise
_LOG.debug('fitted params: %s' % p)
if yfit != None:
axes.plot(data['z'], yfit, 'r-', label='fit')
+ axes.autoscale(tight=True)
axes.set_title('bump surface %s' % timestamp)
#axes.legend(loc='upper left')
axes.set_xlabel('Z piezo (meters)')
# second subplot for residual
residual_axes.plot(data['z'], data['deflection'] - yfit,
'r-', label='residual')
+ residual_axes.autoscale(tight=True)
#residual_axes.legend(loc='upper right')
residual_axes.set_xlabel('Z piezo (meters)')
residual_axes.set_ylabel('Photodiode (Volts)')
if hasattr(figure, 'show'):
figure.show()
+ return figure
_plot = plot # alternative name for use inside fit()