Skip to content

Commit

Permalink
calibration: expose local drag coefficient
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepVanlier committed Oct 11, 2024
1 parent 867865e commit b263f13
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 12 additions & 0 deletions lumicks/pylake/force_calibration/detail/calibration_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ def displacement_sensitivity(self):
"""
return self._get_parameter("Rd", "Rd (um/V)")

@property
def local_drag_coefficient(self):
"""Measured local drag coefficient (kg/s)
.. note::
This parameter is only available when using active calibration.
Represents the drag at the height the calibration was performed. For the value corrected
back to bulk, see :attr:`measured_drag_coefficient`.
"""
return self._get_parameter("local_drag_coefficient", "local_drag_coefficient (kg/s)")

@property
def measured_drag_coefficient(self):
"""Measured bulk drag coefficient (kg/s)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
import scipy
import pytest

from lumicks.pylake.force_calibration.calibration_models import ActiveCalibrationModel
Expand Down Expand Up @@ -90,6 +89,7 @@ def test_integration_active_calibration(
np.testing.assert_allclose(
fit["local_drag_coefficient"].value, drag_coeff_calc * 1e12, rtol=1e-9
)
np.testing.assert_allclose(fit.local_drag_coefficient, drag_coeff_calc * 1e12, rtol=1e-9)

np.testing.assert_allclose(fit["Bead diameter"].value, bead_diameter)
np.testing.assert_allclose(fit["Driving frequency (guess)"].value, driving_frequency_guess)
Expand Down Expand Up @@ -188,10 +188,13 @@ def test_faxen_correction_active(active_calibration_surface_data):
# gamma_0 and gamma_ex should be the same, since gamma_ex is corrected to be "in bulk".
np.testing.assert_allclose(fit.results["gamma_0"].value, 1.0678273429551705e-08)
np.testing.assert_allclose(fit.results["gamma_ex"].value, 1.1271667835127709e-08)
local_drag = 1.1271667835127709e-08 * faxen_factor(
shared_pars["distance_to_surface"], shared_pars["bead_diameter"] / 2
)
np.testing.assert_allclose(fit.results["local_drag_coefficient"].value, local_drag)
np.testing.assert_allclose(
fit.results["local_drag_coefficient"].value,
1.1271667835127709e-08
* faxen_factor(shared_pars["distance_to_surface"], shared_pars["bead_diameter"] / 2),
fit.local_drag_coefficient,
local_drag,
)

# Disabling Faxen's correction on the drag makes the estimates *much* worse
Expand Down

0 comments on commit b263f13

Please sign in to comment.