self.info = {}
for key,value in [
('force zero non-contact slope', False),
- ('ignore non-contact before index', 6158),
+ ('ignore non-contact before index', -1),
('min position', 0), # Store postions etc. to avoid recalculating.
('max position', len(data)),
('max deflection', data.max()),
Data block for which the force should be calculated. For an
approach/retract force curve, `0` selects the approaching curve and `1`
selects the retracting curve.
+""".strip()),
+ Argument(name='ignore index', type='int', default=None,
+ help="""
+Ignore the residual from the non-contact region before the indexed
+point (for the `wtk` algorithm).
""".strip()),
Argument(name='input distance column', type='string',
default='z piezo (m)',
def_data = data[:,data.info['columns'].index(
params['input deflection column'])]
i,def_offset,ps = self.find_contact_point(
- params['curve'], dist_data, def_data, outqueue)
+ params, dist_data, def_data, outqueue)
dist_offset = dist_data[i]
new.info[join_data_label(params['distance info name'], dist_units
)] = dist_offset
new[:,-1] = def_data - def_offset
params['curve'].data[params['block']] = new
- def find_contact_point(self, curve, z_data, d_data, outqueue=None):
+ def find_contact_point(self, params, z_data, d_data, outqueue=None):
"""Railyard for the `find_contact_point_*` family.
Uses the `surface contact point algorithm` configuration
"""
fn = getattr(self, 'find_contact_point_%s'
% self.plugin.config['surface contact point algorithm'])
- return fn(curve, z_data, d_data, outqueue)
+ return fn(params, z_data, d_data, outqueue)
- def find_contact_point_fmms(self, curve, z_data, d_data, outqueue=None):
+ def find_contact_point_fmms(self, params, z_data, d_data, outqueue=None):
"""Algorithm by Francesco Musiani and Massimo Sandal.
Notes
curve, until you find a point with greater than baseline
deflection. That point is the contact point.
"""
- if curve.info['filetype'] == 'picoforce':
+ if params['curve'].info['filetype'] == 'picoforce':
# Take care of the picoforce trigger bug (TODO: example
# data file demonstrating the bug). We exclude portions
# of the curve that have too much standard deviation.
i += 1
return (i, d_baseline, {})
- def find_contact_point_ms(self, curve, z_data, d_data, outqueue=None):
+ def find_contact_point_ms(self, params, z_data, d_data, outqueue=None):
"""Algorithm by Massimo Sandal.
Notes
else:
return dummy.index
- def find_contact_point_wtk(self, curve, z_data, d_data, outqueue=None):
+ def find_contact_point_wtk(self, params, z_data, d_data, outqueue=None):
"""Algorithm by W. Trevor King.
Notes
s = SurfacePositionModel(d_data, info={
'force zero non-contact slope':True},
rescale=True)
+ if params['ignore index'] != None:
+ s.info['ignore non-contact before index'] = params['ignore index']
offset,contact_slope,surface_index,non_contact_slope = s.fit(
outqueue=outqueue)
info = {