From ee7842a5b4b96b73e3603946eed48874e1640a70 Mon Sep 17 00:00:00 2001 From: David Miguel Susano Pinto Date: Fri, 6 Jan 2023 14:04:23 +0000 Subject: [PATCH] Camera: remove "transform" setting (#260) We have `Camera.set_transform` and `Camera.get_transform` methods to control the client transform. There is also a readout transform (only used by PVCamera at the moment). The transform setting exposes the merge of the those two. We want settings to be device specific stuff and not general camera stuff that should be a ABC method. This commit removes the transform setting from Camera. --- NEWS.rst | 5 +++++ microscope/abc.py | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index bcb0c4d0..5c8c4433 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -23,6 +23,11 @@ Version 0.7.0 (upcoming) removed from the base class and is now only kept by cameras that actually make use of it, namely, ``PVCamera`` and ``AndorAtmcd``. + * All cameras had ``"transform"`` setting. This has been removed. + Use the ``get_transform`` and ``set_transform`` methods instead. + The result may be different since the ``"transform"`` setting also + exposed any internal transformation after readout. + * All filterwheels had a ``"position"`` setting which was redundant with the related get/set methods. The setting was been removed. diff --git a/microscope/abc.py b/microscope/abc.py index 615212e6..f48a9da3 100644 --- a/microscope/abc.py +++ b/microscope/abc.py @@ -836,8 +836,6 @@ class Camera(TriggerTargetMixin, DataDevice): """ - ALLOWED_TRANSFORMS = [p for p in itertools.product(*3 * [[False, True]])] - def __init__(self, **kwargs) -> None: super().__init__(**kwargs) # Transforms to apply to data (fliplr, flipud, rot90) @@ -847,14 +845,6 @@ def __init__(self, **kwargs) -> None: self._client_transform = (False, False, False) # Result of combining client and readout transforms self._transform = (False, False, False) - # A transform provided by the client. - self.add_setting( - "transform", - "enum", - lambda: Camera.ALLOWED_TRANSFORMS.index(self._transform), - lambda index: self.set_transform(Camera.ALLOWED_TRANSFORMS[index]), - Camera.ALLOWED_TRANSFORMS, - ) self.add_setting("roi", "tuple", self.get_roi, self.set_roi, None) def _process_data(self, data):