if self.info.get('force zero non-contact slope', None) == True:
p = list(p)
p.append(0.) # restore the non-contact slope parameter
- r2 = numpy.round(p[2])
+ r2 = numpy.round(abs(p[2]))
if r2 >= 1:
self._model_data[:r2] = p[0] + p[1] * numpy.arange(r2)
if r2 < len(self._data)-1:
def fit(self, *args, **kwargs):
self.info['guessed contact slope'] = None
params = super(SurfacePositionModel, self).fit(*args, **kwargs)
+ params[2] = abs(params[2])
if self.info.get('force zero non-contact slope', None) == True:
params = list(params)
params.append(0.) # restore the non-contact slope parameter