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)
residual_axes.set_ylabel('Photodiode (Volts)')
if hasattr(figure, 'show'):
figure.show()
- return plot
+ return figure
_plot = plot # alternative name for use inside fit()