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
7 changes: 3 additions & 4 deletions src/pymodaq_plugins_utils/hardware/camera_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ class CameraBase(DAQ_Viewer_base):

callback_signal = QtCore.Signal(Grab)
live_mode_available = True
# The camera thread already averages Naverage frames (Grab.n_average): once the pymodaq releases that contain the fix
# of the live mode (PyMoDAQ #1421) are the minimum required, this should be True, otherwise the viewer averages
# the averaged frames a second time.
hardware_averaging = False
# The camera thread already averages Naverage frames (Grab.n_average), so the viewer must not average them again. It
# does not since pymodaq 5.3.9 (PyMoDAQ #1421, the live mode no longer depends on hardware_averaging).
hardware_averaging = True

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
6 changes: 6 additions & 0 deletions tests/test_camera_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ def test_optional_methods_are_harmless(self):


class TestCameraBase:
def test_the_camera_averages_so_the_viewer_does_not(self):
"""The frames are averaged by the camera thread (Grab.n_average): the viewer averaging them again would grab
Naverage x Naverage frames"""
assert CameraBase.hardware_averaging is True
assert CameraBase.live_mode_available is True

def test_grab_a_full_frame(self, camera):
dte = grab_and_wait(camera)
assert dte[0].shape == (HEIGHT, WIDTH)
Expand Down
Loading