ForceBaseLine

lumicks.pylake.ForceBaseLine

class ForceBaseLine(model, trap_data, force)

A force baseline as a function of trap position

correct_data(force, trap_position)

Apply baseline correction to force data.

Returns a slice with the baseline subtracted from the force data.

Parameters:
  • force (Slice) – Force data.

  • trap_position (Slice) – Trap position data (needs to be the same time range as the force data).

plot(**kwargs)

Plot baseline fit

Parameters:

**kwargs – Forwarded to matplotlib.pyplot.scatter().

plot_residual(**kwargs)

Plot residual

Parameters:

**kwargs – Forwarded to matplotlib.pyplot.scatter().

classmethod polynomial_baseline(trap_position, force, degree=7, downsampling_factor=None)

Generate a polynomial baseline from data

Parameters:
  • trap_position (Slice) – Trap mirror position data

  • force (Slice) – Force data

  • degree (int) – Polynomial degree

  • downsampling_factor (int) – Factor by which to downsample before baseline determination

valid_range()

Returns valid range of the baseline

Returns the range of trap positions used to parameterize this baseline.