Skip to content

Commit

Permalink
calibration: add test that triggers warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepVanlier committed Aug 22, 2024
1 parent 56cd404 commit 390b703
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest

from lumicks.pylake.force_calibration import power_spectrum_calibration as psc
from lumicks.pylake.force_calibration.power_spectrum import PowerSpectrum
from lumicks.pylake.force_calibration.calibration_models import (
NoFilter,
PassiveCalibrationModel,
Expand Down Expand Up @@ -60,6 +61,30 @@ def test_calibration_result():
psc.CalibrationResults(invalid=5)


def test_fit_warn():
# fmt:off
power = [
1.64129e-04, 1.43886e-05, 7.34803e-06, 7.23357e-06, 6.01199e-06, 5.71373e-06, 6.20084e-06,
5.16348e-06, 5.61539e-06, 4.88627e-06, 5.21241e-06,
]

frequency = [
1204.923, 3204.795, 5204.667, 7204.538, 9204.411, 11204.283, 13204.155, 15204.027,
17203.899, 19341.362, 21523.622,
]
# fmt:on

ps = PowerSpectrum(np.arange(len(frequency)), 78125)
ps.power, ps.frequency = np.asarray(power), np.array(frequency)

psc.fit_power_spectrum(
ps,
PassiveCalibrationModel(1.0),
bias_correction=False,
loss_function="lorentzian",
)


@pytest.mark.parametrize(
"loss_function, corner_frequency,diffusion_constant,alpha,f_diode,num_samples,viscosity,bead_diameter,temperature",
[
Expand Down

0 comments on commit 390b703

Please sign in to comment.