Skip to content

Commit

Permalink
plot_correlated: add include_dead_time
Browse files Browse the repository at this point in the history
The defaults ensure that this change is not breaking
  • Loading branch information
JoepVanlier committed Jan 24, 2024
1 parent 2d532ab commit 5380adb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

## v1.3.2 | t.b.d.

#### New features

* Add option to `include_dead_time` to [`ImageStack.plot_correlated()`](https://lumicks-pylake.readthedocs.io/en/v1.3.0/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.plot_correlated) for `Scan` and `ImageStack`. This parameter defaults to `True`.

#### Bug fixes

* Fixed a bug where the time indicator was off by one frame in [`ImageStack.plot_correlated()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.plot_correlated) and [`ImageStack.export_video()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.export_video).
* Fixed a bug where the time between frames was incorrectly not excluded when calling [`ImageStack.frame_timestamp_ranges()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.frame_timestamp_ranges) with `include_dead_time=False`. Note that `Scan` and `Kymo` are not affected.
* Fixed a bug where [`ImageStack.plot_correlated()`](https://lumicks-pylake.readthedocs.io/en/v1.3.0/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.plot_correlated) was not excluding the dead time between frames.
* Changed the `DateTime` tag on TIFFs exported with Pylake from `Scan` and `Kymo` objects. Before the change, the start and end of the scanning period in nanoseconds was stored. After the change, we store the starting timestamp of the frame, followed by the starting timestamp of the next frame to be consistent with data exported from Bluelake. The scanning time is stored in the field `Exposure time (ms)` on the Description tag.

## v1.3.1 | 2023-12-07
Expand Down
13 changes: 8 additions & 5 deletions lumicks/pylake/image_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ def plot_correlated(
adjustment=no_adjustment,
*,
vertical=False,
include_dead_time=False,
return_frame_setter=False,
):
"""Downsample channel on a frame by frame basis and plot the results. The downsampling
Expand Down Expand Up @@ -513,10 +514,12 @@ def plot_correlated(
figure.
adjustment : lk.ColorAdjustment
Color adjustments to apply to the output image.
vertical : bool
Align plots vertically.
return_frame_setter : bool
Whether to return a handle that allows updating the plotted frame.
vertical : bool, optional
Align plots vertically, default: False.
include_dead_time : bool, optional
Include dead time between frames, default: False.
return_frame_setter : bool, optional
Whether to return a handle that allows updating the plotted frame, default: False.
Note
----
Expand All @@ -543,7 +546,7 @@ def post_update(image_handle, image):

frame_setter = plot_correlated(
channel_slice=channel_slice,
frame_timestamps=self.frame_timestamp_ranges(),
frame_timestamps=self.frame_timestamp_ranges(include_dead_time=include_dead_time),
get_plot_data=frame_grabber,
title_factory=lambda frame: make_image_title(self, frame, show_name=False),
frame=frame,
Expand Down
9 changes: 6 additions & 3 deletions lumicks/pylake/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def plot_correlated(
adjustment=no_adjustment,
*,
vertical=False,
include_dead_time=False,
return_frame_setter=False,
):
"""Downsample channel on a frame by frame basis and plot the results. The downsampling
Expand Down Expand Up @@ -324,9 +325,11 @@ def plot_correlated(
figure.
adjustment : lk.ColorAdjustment
Color adjustments to apply to the output image.
vertical : bool
vertical : bool, optional
Align plots vertically.
return_frame_setter : bool
include_dead_time : bool, optional
Include dead time between scan frames.
return_frame_setter : bool, optional
Whether to return a handle that allows updating the plotted frame.
Examples
Expand All @@ -353,7 +356,7 @@ def post_update(image_handle, image):
def title_factory(frame):
return make_image_title(self, frame, show_name=False)

frame_timestamps = self.frame_timestamp_ranges()
frame_timestamps = self.frame_timestamp_ranges(include_dead_time=include_dead_time)

frame_setter = plot_correlated(
channel_slice,
Expand Down

0 comments on commit 5380adb

Please sign in to comment.