PassiveCalibrationModel

lumicks.pylake.PassiveCalibrationModel

class PassiveCalibrationModel(bead_diameter, viscosity=None, temperature=20, hydrodynamically_correct=False, distance_to_surface=None, rho_sample=None, rho_bead=1060.0, fast_sensor=False, axial=False)

Model to fit data acquired during passive calibration.

Passive calibration involves fitting a power spectral density using a physical model of Brownian motion of a bead inside an optical trap.

The power spectrum calibration algorithm implemented here is based on a number of publications by the Flyvbjerg group at DTU [1] [2] [3] [4] [5] [6]. Please refer to the theory section and tutorial on force calibration for more information on the calibration methods implemented.

Parameters:
  • bead_diameter (float) – Bead diameter [um].

  • viscosity (float, optional) – Liquid viscosity [Pa*s]. When omitted, the temperature will be used to look up the viscosity of water at that particular temperature.

  • temperature (float, optional) – Liquid temperature [Celsius].

  • hydrodynamically_correct (bool, optional) – Enable hydrodynamic correction.

  • distance_to_surface (float, optional) – Distance from bead center to the surface [um]. When specifying None, the model will use an approximation which is only suitable for measurements performed deep in bulk.

  • rho_sample (float, optional) – Density of the sample [kg/m^3]. Only used when using hydrodynamic corrections.

  • rho_bead (float, optional) – Density of the bead [kg/m^3]. Only used when using hydrodynamic corrections.

  • fast_sensor (bool) – Fast sensor? Fast sensors do not have the diode effect included in the model.

  • axial (bool) – Is this an axial force model?

Raises:
  • ValueError – If physical parameters are provided that are outside their sensible range.

  • ValueError – If the distance from the bead center to the surface is set smaller than the bead radius.

  • ValueError – If the hydrodynamically correct model is enabled, but the distance to the surface is specified below 0.75 times the bead diameter (this model is not valid so close to the surface).

  • NotImplementedError – If the hydrodynamically correct model is selected in conjunction with axial force calibration.

References

Examples

f = lk.File("passive_calibration.h5")
force_slice = f.force1x

# Decalibrate existing data
volts = force_slice / force_slice.calibration[0]["Response (pN/V)"]

power_spectrum = lk.calculate_power_spectrum(
    volts.data,
    sample_rate=78125,
    excluded_ranges=[[4400, 4500]],  # Exclude a noise peak
    num_points_per_block=350,
)

model = lk.PassiveCalibrationModel(
    bead_diameter=4.89,
    temperature=25,
    hydrodynamically_correct=True,  # Should use hydrodynamic model for big beads
)

fit = lk.fit_power_spectrum(power_spectrum, model)
fit.plot()
__call__(f, fc, diffusion_constant, *filter_params) ndarray

Call self as a function.

calibration_results(fc, diffusion_constant_volts, filter_params, fc_err, diffusion_constant_volts_err, filter_params_err) dict

Compute calibration parameters from cutoff frequency and diffusion constant.

Parameters:
  • fc (float) – Corner frequency, in Hz.

  • diffusion_constant_volts (float) – Diffusion constant, in V^2/s

  • filter_params (list of float) – Parameters for the filter model.

  • fc_err (float) – Corner frequency standard error, in Hz

  • diffusion_constant_volts_err (float) – Diffusion constant standard error, in Hz

  • filter_params_err (list of float) – Standard errors for the filter model