Skip to content

Commit 5a9f9f2

Browse files
authored
Merge pull request #69 from pycroscopy/PyTango-dev-ACH
Py tango dev ach
2 parents 84cb60d + c3901b2 commit 5a9f9f2

12 files changed

Lines changed: 1956 additions & 592 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Asyncroscopy:
22
- Enabling smart microscopy via asynchronous servers
33

4+
![Schematic of the functional project structure](architecture.png)
5+
46
Note: `main` branch now contains the PyTango-based architecture. The previous Twisted-based implementation is preserved in the `twisted-legacy` branch for reference.
57
---
68

architecture.png

1.64 MB
Loading

asyncroscopy/Microscope.py

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ def get_spectrum(self, detector_name: str) -> tuple[str, bytes]:
189189

190190
return json.dumps(metadata), raw_bytes
191191

192+
@command(dtype_out=DevEncoded)
193+
def get_camera_image(self) -> tuple[str, bytes]:
194+
"""
195+
get image on the camera
196+
"""
197+
198+
camera = self._detector_proxies.get("camera")
199+
# use this to get params
192200

193201
@command(dtype_out=DevEncoded)#In PyTango, DevEncoded is a special Tango data type designed to send binary data + a small description string together as a single return value.
194202
def get_scanned_image(self) -> tuple[str, bytes]:
@@ -319,11 +327,32 @@ def unblank_beam(self) -> None:
319327
@command(dtype_in=DevFloat)
320328
def set_fov(self, fov):
321329
"""
322-
set the field of view for the next acquisition, [0:1]
330+
set the field of view for the next acquisition
323331
"""
324332
print(fov)
325333
self._set_fov(fov)
326334

335+
@command(dtype_out=DevFloat)
336+
def get_fov(self):
337+
"""
338+
read the field of view for the next acquisition
339+
"""
340+
return self._get_fov()
341+
342+
@command(dtype_in=DevFloat)
343+
def set_screen_current(self, current):
344+
"""
345+
set the screen current in pA
346+
"""
347+
self._set_screen_current(current)
348+
349+
@command(dtype_out=DevFloat)
350+
def get_screen_current(self):
351+
"""
352+
get the screen current in pA
353+
"""
354+
return self._get_screen_current()
355+
327356
@command(dtype_out=DevVarFloatArray)
328357
def get_stage(self):
329358
"""
@@ -350,6 +379,23 @@ def move_stage(self, position):
350379
"""
351380
self._move_stage(position)
352381

382+
@command()
383+
def auto_focus(self):
384+
"""
385+
Run the microscope's autofocus routine.
386+
"""
387+
self._auto_focus()
388+
389+
@command(dtype_in=DevVarFloatArray)
390+
def set_image_shift(self, shift):
391+
"""
392+
Set the image shift to the specified values [x_shift, y_shift].
393+
394+
Parameters
395+
----------
396+
shift: list of two floats [x_shift, y_shift] specifying the desired image shift in meters.
397+
"""
398+
self._set_image_shift(shift)
353399
# ------------------------------------------------------------------
354400
# Internal acquisition helpers
355401
# ------------------------------------------------------------------
@@ -375,6 +421,15 @@ def _unblank_beam():
375421
# define in the inherit class
376422
pass
377423

424+
@abstractmethod
425+
def _set_screen_current():
426+
# define in the inherit class
427+
pass
428+
429+
@abstractmethod
430+
def _get_screen_current():
431+
pass
432+
378433
@abstractmethod
379434
def _move_stage():
380435
# define in the inherit class
@@ -387,6 +442,18 @@ def _get_stage():
387442
@abstractmethod
388443
def _set_fov():
389444
pass
445+
446+
@abstractmethod
447+
def _get_fov():
448+
pass
449+
450+
@abstractmethod
451+
def _auto_focus():
452+
pass
453+
454+
@abstractmethod
455+
def _set_image_shift():
456+
pass
390457
# ----------------------------------------------------------------------
391458
# Server entry point
392459
# ----------------------------------------------------------------------

0 commit comments

Comments
 (0)