diff --git a/changelog.md b/changelog.md index 480ac4224..4471ed55c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,18 +1,20 @@ # Changelog -## v1.8.0 | t.b.d. +## v1.8.0 | 2025-10-30 -* Added confocal API endpoints [`axis_units`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.scan.Scan.html#lumicks.pylake.scan.Scan.axis_units), [`axis_names`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.scan.Scan.html#lumicks.pylake.scan.Scan.axis_names), [`axis_labels`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.scan.Scan.html#lumicks.pylake.scan.Scan.axis_labels) to get the units, names and labels of the axes of a confocal scan in human-readable form. -* Added feature to adaptively determine the fitting range when fitting power spectra using [`calibrate_force()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.calibrate_force.html#lumicks.pylake.calibrate_force) and [`fit_power_spectrum()`](https://lumicks-pylake.readthedocs.io/en/stable/_api/lumicks.pylake.fit_power_spectrum.html). Provide the parameter `corner_frequency_factor` to use this feature. When provided, the fitting range will be iteratively determined based on the corner frequency of the power spectrum. -* Added the optional argument `data_range` to [`CalibrationResults.plot()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html#lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.plot) to plot a custom frequency range for the data. This helps put the fitted part of the power spectrum in context. +#### New features + +* Added feature to adaptively determine the fitting range when fitting power spectra using [`calibrate_force()`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.calibrate_force.html#lumicks.pylake.calibrate_force) and [`fit_power_spectrum()`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.fit_power_spectrum.html). Provide the parameter `corner_frequency_factor` to use this feature. When provided, the fitting range will be iteratively determined based on the corner frequency of the power spectrum. Note that this feature is only relevant for systems with a factory calibrated diode response. +* Allow [piezo tracking](https://lumicks-pylake.readthedocs.io/en/v1.8.0/api.html#piezo-tracking) to work with force and trap position data with different sampling rates by downsampling the higher rate data to the lower one. The sampling rates are required to be an integer multiple of each other to avoid any interpolation. +* Added the optional argument `data_range` to [`CalibrationResults.plot()`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.html#lumicks.pylake.force_calibration.power_spectrum_calibration.CalibrationResults.plot) to plot a custom frequency range for the data. This helps put the fitted part of the power spectrum in context. +* Added the optional argument `where="left"` to [`Slice.downsampled_by()`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.channel.Slice.html#lumicks.pylake.channel.Slice.downsampled_by) to downsample by a factor while keeping the original timestamps. The default remains `"center"`. +* Added confocal API endpoints [`axis_units`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.scan.Scan.html#lumicks.pylake.scan.Scan.axis_units), [`axis_names`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.scan.Scan.html#lumicks.pylake.scan.Scan.axis_names), [`axis_labels`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.scan.Scan.html#lumicks.pylake.scan.Scan.axis_labels) to get the units, names and labels of the axes of a confocal scan in human-readable form. * Bump `tabulate` dependency to allow versions up to `<0.11`. -* Added the optional argument `where="left"` to [`Slice.donwsampled_by()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.channel.Slice.html#lumicks.pylake.channel.Slice.downsampled_by) to downsample by a factor while keeping the original timestamps. The default remains `"center"`. -* Allow [piezo tracking](https://lumicks-pylake.readthedocs.io/en/latest/api.html#piezo-tracking) to work with force and trap position data with different sampling rates by downsampling the higher rate data to the lower one. The sampling are required to be integer multiple of each other to avoid any interpolation. -* Added support for Bluelake force calibration items that use adaptive fitting ranges. To get the initial fitting range used during calibration (the one entered in the UI), we added the property [`ForceCalibrationItem.initial_fit_range`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.calibration.ForceCalibrationItem.html#lumicks.pylake.calibration.ForceCalibrationItem.initial_fit_range). For the final fit range, use the existing property [`ForceCalibrationItem.fit_range`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.calibration.ForceCalibrationItem.html#lumicks.pylake.calibration.ForceCalibrationItem.fit_range). The used corner frequency factor can be found in [`ForceCalibrationItem.corner_frequency_factor`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.calibration.ForceCalibrationItem.html#lumicks.pylake.calibration.ForceCalibrationItem.corner_frequency_factor). For more information see the [tutorial](https://lumicks-pylake.readthedocs.io/en/latest/tutorial/force_calibration/diode_model.html): +* Added support for Bluelake force calibration items that use adaptive fitting ranges. To get the initial fitting range used during calibration (the one entered in the UI), we added the property [`ForceCalibrationItem.initial_fit_range`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.calibration.ForceCalibrationItem.html#lumicks.pylake.calibration.ForceCalibrationItem.initial_fit_range). For the final fit range, use the existing property [`ForceCalibrationItem.fit_range`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.calibration.ForceCalibrationItem.html#lumicks.pylake.calibration.ForceCalibrationItem.fit_range). The used corner frequency factor can be found in [`ForceCalibrationItem.corner_frequency_factor`](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.calibration.ForceCalibrationItem.html#lumicks.pylake.calibration.ForceCalibrationItem.corner_frequency_factor). For more information see the [tutorial](https://lumicks-pylake.readthedocs.io/en/v1.8.0/tutorial/force_calibration/diode_model.html): #### Bug fixes -- Fixed a bug that could affect calibrations returned by [Slice.calibration](https://lumicks-pylake.readthedocs.io/en/v1.7.0/_api/lumicks.pylake.channel.Slice.html#lumicks.pylake.channel.Slice.calibration) with a stop time of `0` (01/01/1970). This bug could affect mocked force and calibration data, but it should not affect real data. +- Fixed a bug that could affect calibrations returned by [Slice.calibration](https://lumicks-pylake.readthedocs.io/en/v1.8.0/_api/lumicks.pylake.channel.Slice.html#lumicks.pylake.channel.Slice.calibration) with a stop time of `0` (01/01/1970). This bug could affect mocked force and calibration data, but it should not affect real data. ## v1.7.0 | 2025-07-29 diff --git a/docs/whatsnew/1.8.0/1_8_0.rst b/docs/whatsnew/1.8.0/1_8_0.rst new file mode 100644 index 000000000..5674b1fb9 --- /dev/null +++ b/docs/whatsnew/1.8.0/1_8_0.rst @@ -0,0 +1,34 @@ +Pylake 1.8.0 +============ + +.. only:: html + +Here is an overview of features that were released in Pylake `v1.8.0`. + +Automatic fitting ranges +------------------------ + +When fitting force calibration spectra, it is important to exclude regions of the power spectrum with a poor signal-to-noise ratio. +For systems that have a force sensor with a factory calibrated frequency response, we can now automatically select an appropriate fit range by passing the extra parameter :attr:`~lumicks.pylake.calibration.ForceCalibrationItem.corner_frequency_factor` to :func:`~lumicks.pylake.calibrate_force()`. + +This parameter sets the fitting range from 0.1 times below to :attr:`~lumicks.pylake.calibration.ForceCalibrationItem.corner_frequency_factor` times above the corner frequency. +This approach helps exclude regions of the spectrum that may be affected by low power or other artifacts during fitting:: + + calibration = lk.calibrate_force(volts.data, **calibration_params, corner_frequency_factor=4) + calibration.plot(data_range=(5, 23000)) + plt.title(f"Stiffness = {calibration.stiffness:.2f}"); + +.. image:: adaptive_ranges.png + +Note that the final fitting range is always constrained by the user-defined initial fit range. + +For fits obtained with Bluelake using automatic fitting ranges, the user defined initial fitting ranges and used corner frequency factor can be found in :attr:`~lumicks.pylake.calibration.ForceCalibrationItem.initial_fit_range` and :attr:`~lumicks.pylake.calibration.ForceCalibrationItem.corner_frequency_factor`, while the iteratively determined fitting range can be found in :attr:`~lumicks.pylake.calibration.ForceCalibrationItem.fit_range`. + +For more information, please refer to the updated :ref:`tutorial`. + +Other changes +------------- + +For a full list of all the changes, please refer to the full :doc:`changelog`. + +Happy Pylake-ing! diff --git a/docs/whatsnew/1.8.0/adaptive_ranges.png b/docs/whatsnew/1.8.0/adaptive_ranges.png new file mode 100644 index 000000000..8d3714158 --- /dev/null +++ b/docs/whatsnew/1.8.0/adaptive_ranges.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbda3703c9672d29fcb7387e253f4c0a46ab4c10aeb41c2eb965b519bdcfd1d8 +size 25819 diff --git a/docs/whatsnew/index.rst b/docs/whatsnew/index.rst index 67b26ba8e..936ecc34d 100644 --- a/docs/whatsnew/index.rst +++ b/docs/whatsnew/index.rst @@ -8,6 +8,7 @@ For a full list of new features and changes, please refer to the :doc:`changelog :caption: Contents :maxdepth: 1 + 1.8.0/1_8_0 1.7.0/1_7_0 1.6.0/1_6_0 1.5.0/1_5_0 diff --git a/lumicks/pylake/__about__.py b/lumicks/pylake/__about__.py index ecce6a9a9..7cac93d67 100644 --- a/lumicks/pylake/__about__.py +++ b/lumicks/pylake/__about__.py @@ -1,5 +1,5 @@ __title__ = "lumicks.pylake" -__version__ = "1.7.0" +__version__ = "1.8.0" __summary__ = "Bluelake data analysis tools" __url__ = "https://github.com/lumicks/pylake"