Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
34 changes: 34 additions & 0 deletions docs/whatsnew/1.8.0/1_8_0.rst
Original file line number Diff line number Diff line change
@@ -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<diode_tutorial>`.

Other changes
-------------

For a full list of all the changes, please refer to the full :doc:`changelog</changelog>`.

Happy Pylake-ing!
3 changes: 3 additions & 0 deletions docs/whatsnew/1.8.0/adaptive_ranges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/whatsnew/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lumicks/pylake/__about__.py
Original file line number Diff line number Diff line change
@@ -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"

Expand Down