Skip to content

Commit

Permalink
Camera: remove "transform" setting (#260)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
carandraug committed Jan 6, 2023
1 parent d5e6c39 commit ee7842a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 5 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 0 additions & 10 deletions microscope/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down

0 comments on commit ee7842a

Please sign in to comment.