BioImager  4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
microscope.cameras.atmcd.AndorAtmcd Class Reference
Inheritance diagram for microscope.cameras.atmcd.AndorAtmcd:
microscope.abc.FloatingDeviceMixin microscope.abc.Camera microscope.abc.TriggerTargetMixin microscope.abc.DataDevice microscope.abc.Device

Public Member Functions

 __init__ (self, index=0, **kwargs)
 
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 
 abort (self)
 
 initialize (self)
 
 get_id (self)
 
 set_exposure_time (self, value)
 
 get_exposure_time (self)
 
 get_cycle_time (self)
 
 soft_trigger (self)
 
microscope.TriggerMode trigger_mode (self)
 
microscope.TriggerType trigger_type (self)
 
None set_trigger (self, microscope.TriggerType ttype, microscope.TriggerMode tmode)
 
- Public Member Functions inherited from microscope.abc.FloatingDeviceMixin
- Public Member Functions inherited from microscope.abc.Camera
 set_readout_mode (self, description)
 
 get_transform (self)
 
 set_transform (self, transform)
 
typing.Tuple[int, int] get_sensor_shape (self)
 
microscope.Binning get_binning (self)
 
None set_binning (self, microscope.Binning binning)
 
microscope.ROI get_roi (self)
 
None set_roi (self, microscope.ROI roi)
 
- Public Member Functions inherited from microscope.abc.TriggerTargetMixin
None trigger (self)
 
- Public Member Functions inherited from microscope.abc.DataDevice
 __del__ (self)
 
None enable (self)
 
None disable (self)
 
None set_client (self, new_client)
 
None update_settings (self, settings, bool init=False)
 
None receiveClient (self, str client_uri)
 
 grab_next_data (self, bool soft_trigger=True)
 
None receiveData (self, data, timestamp)
 
- Public Member Functions inherited from microscope.abc.Device
bool get_is_enabled (self)
 
None shutdown (self)
 
None add_setting (self, name, dtype, get_func, set_func, values, typing.Optional[typing.Callable[[], bool]] readonly=None)
 
 get_setting (self, str name)
 
 get_all_settings (self)
 
None set_setting (self, str name, value)
 
 describe_setting (self, str name)
 
 describe_settings (self)
 

Public Attributes

 amplifiers
 
 get_binning = "Binning"
 
 set_binning
 
 get_roi = "Roi"
 
- Public Attributes inherited from microscope.abc.Camera
 set_readout_mode
 
 get_roi
 
 set_roi
 
- Public Attributes inherited from microscope.abc.DataDevice
bool enabled = False
 
bool _fetch_thread = True
 
bool _dispatch_thread = True
 
None _fetch_thread_run = self._fetch_data()
 
- Public Attributes inherited from microscope.abc.Device
bool enabled = False
 

Protected Member Functions

 _bind (self, fn)
 
 _acquiring (self)
 
 _acquiring (self, value)
 
 _set_cooler_state (self, state)
 
 _fetch_data (self)
 
None _do_shutdown (self)
 
 _do_disable (self)
 
 _do_enable (self)
 
 _set_image (self)
 
 _set_readout_mode (self, mode_index)
 
 _get_sensor_shape (self)
 
 _get_sensor_temperature (self)
 
None _do_trigger (self)
 
 _get_binning (self)
 
 _set_binning (self, binning)
 
 _get_roi (self)
 
 _set_roi (self, roi)
 
- Protected Member Functions inherited from microscope.abc.Camera
 _process_data (self, data)
 
 _set_readout_transform (self, new_transform)
 
- Protected Member Functions inherited from microscope.abc.TriggerTargetMixin
- Protected Member Functions inherited from microscope.abc.DataDevice
 _send_data (self, client, data, timestamp)
 
None _dispatch_loop (self)
 
None _fetch_loop (self)
 
 _client (self)
 
 _client (self, val)
 
None _put (self, data, timestamp)
 
- Protected Member Functions inherited from microscope.abc.Device

Protected Attributes

int _rdepth = 0
 
 _handle = None
 
 _roi = None
 
 _binning = None
 
 _caps = GetCapabilities()
 
list _readout_modes = []
 
 _set_readout_mode
 
 _get_sensor_temperature
 
 _set_cooler_state
 
 _acquiring
 
- Protected Attributes inherited from microscope.abc.FloatingDeviceMixin
 _index = index
 
- Protected Attributes inherited from microscope.abc.Camera
list _readout_modes = ["default"]
 
int _readout_mode = 0
 
tuple _readout_transform = (False, False, False)
 
tuple _client_transform = (False, False, False)
 
tuple _transform = (False, False, False)
 
- Protected Attributes inherited from microscope.abc.DataDevice
 _fetch_thread = None
 
bool _fetch_thread_run = False
 
bool _using_callback = False
 
list _clientStack = []
 
 _liveClients = set()
 
 _dispatch_thread = None
 
 _dispatch_buffer = queue.Queue(maxsize=buffer_length)
 
 _new_data_condition = threading.Condition()
 
 _client = None
 
tuple _new_data = (data, timestamp)
 
- Protected Attributes inherited from microscope.abc.Device
dict _settings = {}
 

Additional Inherited Members

- Static Public Attributes inherited from microscope.abc.Camera
list ALLOWED_TRANSFORMS = [p for p in itertools.product(*3 * [[False, True]])]
 
- Static Public Attributes inherited from microscope.abc.DataDevice
 set_setting = keep_acquiring(Device.set_setting)
 

Detailed Description

Implements CameraDevice interface for Andor ATMCD library.

Definition at line 1364 of file atmcd.py.

Constructor & Destructor Documentation

◆ __init__()

microscope.cameras.atmcd.AndorAtmcd.__init__ ( self,
index = 0,
** kwargs )

Reimplemented from microscope.abc.FloatingDeviceMixin.

Definition at line 1370 of file atmcd.py.

1370 def __init__(self, index=0, **kwargs):
1371 super().__init__(index=index, **kwargs)
1372 # Recursion depth for context manager behaviour.
1373 self._rdepth = 0
1374 # The handle used by the DLL to identify this camera.
1375 self._handle = None
1376 # The following parameters will be populated after hardware init.
1377 self._roi = None
1378 self._binning = None
1379 self.initialize()
1380

Member Function Documentation

◆ __enter__()

microscope.cameras.atmcd.AndorAtmcd.__enter__ ( self)
Context manager entry code.

The camera class is also a context manager that ensures DLL calls act
on this camera by obtaining the _dll_lock.

We could use RLock to give re-entrant behaviour, but we track recursion
ourselves so that we know when we must call SetCurrentCamera.

Definition at line 1391 of file atmcd.py.

1391 def __enter__(self):
1392 """Context manager entry code.
1393
1394 The camera class is also a context manager that ensures DLL calls act
1395 on this camera by obtaining the _dll_lock.
1396
1397 We could use RLock to give re-entrant behaviour, but we track recursion
1398 ourselves so that we know when we must call SetCurrentCamera.
1399 """
1400 if self._rdepth == 0:
1401 _dll_lock.acquire()
1402 SetCurrentCamera(self._handle)
1403 self._rdepth += 1
1404

◆ __exit__()

microscope.cameras.atmcd.AndorAtmcd.__exit__ ( self,
exc_type,
exc_value,
traceback )
Context manager exit code.

Definition at line 1405 of file atmcd.py.

1405 def __exit__(self, exc_type, exc_value, traceback):
1406 """Context manager exit code."""
1407 self._rdepth -= 1
1408 if self._rdepth == 0:
1409 _dll_lock.release()
1410

◆ _acquiring() [1/2]

microscope.cameras.atmcd.AndorAtmcd._acquiring ( self)
protected
Indicate whether or not camera is acquiring data.

Reimplemented from microscope.abc.DataDevice.

Definition at line 1412 of file atmcd.py.

1412 def _acquiring(self):
1413 """Indicate whether or not camera is acquiring data."""
1414 with self:
1415 return GetStatus() == DRV_ACQUIRING
1416

◆ _acquiring() [2/2]

microscope.cameras.atmcd.AndorAtmcd._acquiring ( self,
value )
protected

Reimplemented from microscope.abc.DataDevice.

Definition at line 1418 of file atmcd.py.

1418 def _acquiring(self, value):
1419 # Here to prevent an error when super.__init__ intializes
1420 # self._acquiring. Doesn't do anything, because the DLL keeps
1421 # track of acquisition state.
1422 pass
1423

◆ _bind()

microscope.cameras.atmcd.AndorAtmcd._bind ( self,
fn )
protected
Binds unbound SDK functions to this camera.

Definition at line 1381 of file atmcd.py.

1381 def _bind(self, fn):
1382 """Binds unbound SDK functions to this camera."""
1383
1384 @functools.wraps(fn)
1385 def wrapper(*args, **kwargs):
1386 with self:
1387 return fn(*args, **kwargs)
1388
1389 return wrapper
1390

◆ _do_disable()

microscope.cameras.atmcd.AndorAtmcd._do_disable ( self)
protected
Call abort to stop acquisition.

Reimplemented from microscope.abc.Device.

Definition at line 1650 of file atmcd.py.

1650 def _do_disable(self):
1651 """Call abort to stop acquisition."""
1652 self.abort()
1653

◆ _do_enable()

microscope.cameras.atmcd.AndorAtmcd._do_enable ( self)
protected
Enter data acquisition state.

Reimplemented from microscope.abc.Device.

Definition at line 1654 of file atmcd.py.

1654 def _do_enable(self):
1655 """Enter data acquisition state."""
1656 if self._acquiring:
1657 self.abort()
1658 with self:
1659 SetAcquisitionMode(AcquisitionMode.RUNTILLABORT)
1660 SetShutter(1, 1, 1, 1)
1661 SetReadMode(ReadMode.IMAGE)
1662 x, y = GetDetector()
1663 self._set_image()
1664 if not IsTriggerModeAvailable(self.get_setting("TriggerMode")):
1666 "Trigger mode is not valid."
1667 )
1668 StartAcquisition()
1669 return True
1670

◆ _do_shutdown()

None microscope.cameras.atmcd.AndorAtmcd._do_shutdown ( self)
protected
Warm up the sensor then shut down the camera.

This may take some time, so we should ensure that the _dll_lock is
released when we don't need it.

Reimplemented from microscope.abc.Device.

Definition at line 1623 of file atmcd.py.

1623 def _do_shutdown(self) -> None:
1624 """Warm up the sensor then shut down the camera.
1625
1626 This may take some time, so we should ensure that the _dll_lock is
1627 released when we don't need it."""
1628 # Switch off cooler then release lock.
1629 with self:
1630 CoolerOFF()
1631
1632 _logger.info(
1633 "Waiting for temperature to rise above -20C" " before shutdown ..."
1634 )
1635
1636 while True:
1637 # Check temperature then release lock.
1638 with self:
1639 t = GetTemperature()[1]
1640 _logger.info("... T = %dC", t)
1641 if t > -20:
1642 break
1643 time.sleep(10)
1644
1645 _logger.info("Temperature is %dC: shutting down camera.", t)
1646
1647 with self:
1648 ShutDown()
1649

◆ _do_trigger()

None microscope.cameras.atmcd.AndorAtmcd._do_trigger ( self)
protected
Actual trigger of the device.

Classes implementing this interface should implement this
method instead of `trigger`.

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 1779 of file atmcd.py.

1779 def _do_trigger(self) -> None:
1780 with self:
1781 SendSoftwareTrigger()
1782

◆ _fetch_data()

microscope.cameras.atmcd.AndorAtmcd._fetch_data ( self)
protected
Poll for data and return it, with minimal processing.

Returns the data, or None if no data is available.

Reimplemented from microscope.abc.DataDevice.

Definition at line 1599 of file atmcd.py.

1599 def _fetch_data(self):
1600 """Poll for data and return it, with minimal processing.
1601
1602 Returns the data, or None if no data is available.
1603 """
1604 binning = self._binning
1605 roi = self._roi
1606 width = roi.width // binning.h
1607 height = roi.height // binning.v
1608 try:
1609 with self:
1610 data = GetOldestImage16(width * height).reshape(height, width)
1611 except AtmcdException as e:
1612 if e.status == DRV_NO_NEW_DATA:
1613 return None
1614 else:
1615 raise e
1616 return data
1617

◆ _get_binning()

microscope.cameras.atmcd.AndorAtmcd._get_binning ( self)
protected
Return the binning setting.

Reimplemented from microscope.abc.Camera.

Definition at line 1783 of file atmcd.py.

1783 def _get_binning(self):
1784 """Return the binning setting."""
1785 return self._binning
1786

◆ _get_roi()

microscope.cameras.atmcd.AndorAtmcd._get_roi ( self)
protected
Return the current ROI setting.

Reimplemented from microscope.abc.Camera.

Definition at line 1793 of file atmcd.py.

1793 def _get_roi(self):
1794 """Return the current ROI setting."""
1795 return self._roi
1796

◆ _get_sensor_shape()

microscope.cameras.atmcd.AndorAtmcd._get_sensor_shape ( self)
protected
Return the sensor geometry.

Reimplemented from microscope.abc.Camera.

Definition at line 1742 of file atmcd.py.

1742 def _get_sensor_shape(self):
1743 """Return the sensor geometry."""
1744 with self:
1745 return GetDetector()
1746

◆ _get_sensor_temperature()

microscope.cameras.atmcd.AndorAtmcd._get_sensor_temperature ( self)
protected
Return the sensor temperature.

Definition at line 1747 of file atmcd.py.

1747 def _get_sensor_temperature(self):
1748 """Return the sensor temperature."""
1749 with self:
1750 return GetTemperature()[1]
1751

◆ _set_binning()

microscope.cameras.atmcd.AndorAtmcd._set_binning ( self,
binning )
protected
Set horizontal and vertical binning. Default to single pixel.

Reimplemented from microscope.abc.Camera.

Definition at line 1788 of file atmcd.py.

1788 def _set_binning(self, binning):
1789 """Set horizontal and vertical binning. Default to single pixel."""
1790 self._binning = binning
1791 return True
1792

◆ _set_cooler_state()

microscope.cameras.atmcd.AndorAtmcd._set_cooler_state ( self,
state )
protected
Turn the sensor cooler on (True) or off (False)

Definition at line 1434 of file atmcd.py.

1434 def _set_cooler_state(self, state):
1435 """Turn the sensor cooler on (True) or off (False)"""
1436 with self:
1437 if state:
1438 CoolerON()
1439 else:
1440 CoolerOFF()
1441

◆ _set_image()

microscope.cameras.atmcd.AndorAtmcd._set_image ( self)
protected
Set ROI and binning prior to acquisition.

Definition at line 1671 of file atmcd.py.

1671 def _set_image(self):
1672 """Set ROI and binning prior to acquisition."""
1673 binning = (
1674 self._binning
1675 ) # Binning is mode-dependent, so not validated yet.
1676 roi = self._roi # ROI validated in _set_roi, so should be OK
1677 with self:
1678 try:
1679 SetImage(
1680 binning.h,
1681 binning.v,
1682 roi.left,
1683 roi.left + roi.width - 1,
1684 roi.top,
1685 roi.top + roi.height - 1,
1686 )
1687 except AtmcdException as e:
1688 if e.status == DRV_P1INVALID:
1689 out_e = ValueError("Horizontal binning invalid.")
1690 elif e.status == DRV_P2INVALID:
1691 e = ValueError("Vertical binning invalid.")
1692 elif e.status == DRV_P3INVALID:
1693 out_e = ValueError("roi.left invalid.")
1694 elif e.status == DRV_P4INVALID:
1695 out_e = ValueError("roi.width invalid.")
1696 elif e.status == DRV_P5INVALID:
1697 out_e = ValueError("roi.top invalid.")
1698 elif e.status == DRV_P6INVALID:
1699 out_e = ValueError("roi.height invalid.")
1700 else:
1701 out_e = e
1702 # Just raise the descriptive exception, not the chain.
1703 raise out_e from None
1704

◆ _set_readout_mode()

microscope.cameras.atmcd.AndorAtmcd._set_readout_mode ( self,
mode_index )
protected
Configure channel, amplifier and VS-speed.

Definition at line 1728 of file atmcd.py.

1728 def _set_readout_mode(self, mode_index):
1729 """Configure channel, amplifier and VS-speed."""
1730 mode = self._readout_modes[mode_index]
1731 _logger.info("Setting readout mode to %s", mode)
1732 with self:
1733 SetADChannel(mode.channel)
1734 SetOutputAmplifier(mode.amp)
1735 # On (at least) the Ixon Ultra, the two amplifiers read from
1736 # opposite edges from the chip. We set the horizontal flip
1737 # so that the returned image orientation is independent of
1738 # amplifier selection
1739 SetImageFlip(not mode.amp, 0)
1740 SetHSSpeed(mode.amp, mode.hsindex)
1741

◆ _set_roi()

microscope.cameras.atmcd.AndorAtmcd._set_roi ( self,
roi )
protected
Set the ROI, defaulting to full sensor area.

Reimplemented from microscope.abc.Camera.

Definition at line 1798 of file atmcd.py.

1798 def _set_roi(self, roi):
1799 """Set the ROI, defaulting to full sensor area."""
1800 with self:
1801 x, y = GetDetector()
1802 left = roi.left or 1
1803 top = roi.top or 1
1804 width = roi.width or x
1805 height = roi.height or y
1806 if any(
1807 [left < 1, top < 1, left + width - 1 > x, top + height - 1 > y]
1808 ):
1809 return False
1810 self._roi = microscope.ROI(left, top, width, height)
1811 return True

◆ abort()

microscope.cameras.atmcd.AndorAtmcd.abort ( self)
Abort acquisition.

Reimplemented from microscope.abc.DataDevice.

Definition at line 1424 of file atmcd.py.

1424 def abort(self):
1425 """Abort acquisition."""
1426 _logger.debug("Disabling acquisition.")
1427 try:
1428 with self:
1429 AbortAcquisition()
1430 except AtmcdException as e:
1431 if e.status != DRV_IDLE:
1432 raise
1433

◆ get_cycle_time()

microscope.cameras.atmcd.AndorAtmcd.get_cycle_time ( self)
Determine the minimum time between exposures.

Reimplemented from microscope.abc.Camera.

Definition at line 1717 of file atmcd.py.

1717 def get_cycle_time(self):
1718 """Determine the minimum time between exposures."""
1719 with self:
1720 exposure, accumulate, kinetic = GetAcquisitionTimings()
1721 readout = GetReadOutTime()
1722 # IMD 20210422 DeepSIM timing is wrong as the keepclear cycles are
1723 # not accounted for.
1724 # return exposure + readout
1725 # This appears to allow the correct time between trigger pulses.
1726 return kinetic
1727

◆ get_exposure_time()

microscope.cameras.atmcd.AndorAtmcd.get_exposure_time ( self)
Query the actual exposure time.

Reimplemented from microscope.abc.Camera.

Definition at line 1711 of file atmcd.py.

1711 def get_exposure_time(self):
1712 """Query the actual exposure time."""
1713 with self:
1714 exposure, accumulate, kinetic = GetAcquisitionTimings()
1715 return exposure
1716

◆ get_id()

microscope.cameras.atmcd.AndorAtmcd.get_id ( self)
Return the device's unique identifier.

Reimplemented from microscope.abc.FloatingDeviceMixin.

Definition at line 1618 of file atmcd.py.

1618 def get_id(self):
1619 """Return the device's unique identifier."""
1620 with self:
1621 return GetCameraSerialNumber()
1622

◆ initialize()

microscope.cameras.atmcd.AndorAtmcd.initialize ( self)
Initialize the library and hardware and create Setting objects.

Reimplemented from microscope.abc.Device.

Definition at line 1442 of file atmcd.py.

1442 def initialize(self):
1443 """Initialize the library and hardware and create Setting objects."""
1444 _logger.info("Initializing ...")
1445 num_cams = GetAvailableCameras()
1446 if self._index >= num_cams:
1447 msg = "Requested camera %d, but only found %d cameras" % (
1448 self._index,
1449 num_cams,
1450 )
1452 self._handle = GetCameraHandle(self._index)
1453
1454 with self:
1455 # Initialize the library and connect to camera.
1456 Initialize(b"")
1457 # Initialise ROI to full sensor area and binning to single-pixel.
1458 self._set_roi(microscope.ROI(0, 0, 0, 0))
1459 self._set_binning(microscope.Binning(1, 1))
1460 # Check info bits to see if initialization successful.
1461 info = GetCameraInformation(self._index)
1462 if not info & 1 << 2:
1463 raise microscope.InitialiseError("... initialization failed.")
1464 self._caps = GetCapabilities()
1465 model = GetHeadModel()
1466 serial = self.get_id()
1467 # Populate amplifiers
1468 if GetNumberAmp() > 1:
1469 if self._caps.ulCameraType == AC_CAMERATYPE_CLARA:
1470 self.amplifiers = IntEnum(
1471 "Amplifiers",
1472 (("CONVENTIONAL", 0), ("EXTENDED_NIR", 1)),
1473 )
1474 else:
1475 self.amplifiers = IntEnum(
1476 "Amplifiers", (("EMCCD", 0), ("CONVENTIONAL", 1))
1477 )
1478 # Populate readout modes
1479 self._readout_modes = []
1480 for ch in range(GetNumberADChannels()):
1481 for amp in self.amplifiers:
1482 for s in range(GetNumberHSSpeeds(ch, amp.value)):
1483 speed = GetHSSpeed(ch, amp.value, s)
1484 self._readout_modes.append(
1485 ReadoutMode(ch, amp, s, speed)
1486 )
1487 _logger.info("... initilized %s s/n %s", model, serial)
1488 # Add settings. Some are write-only, so we set defaults here.
1489 # Mode
1490 name = "readout mode"
1491 if self._readout_modes:
1492 self.add_setting(
1493 name,
1494 "enum",
1495 None,
1496 self._set_readout_mode,
1497 lambda: [str(mode) for mode in self._readout_modes],
1498 )
1499 self.set_setting(name, 0)
1500 # TriggerMode
1501 name = "TriggerMode"
1502 self.add_setting(
1503 name, "enum", None, self._bind(SetTriggerMode), TriggerMode
1504 )
1505 if self._caps.ulTriggerModes & AC_TRIGGERMODE_EXTERNAL:
1506 self.set_setting(name, TriggerMode.EXTERNAL)
1507 elif self._caps.ulTriggerModes & AC_TRIGGERMODE_CONTINUOUS:
1508 self.set_setting(name, TriggerMode.SOFTWARE)
1509 # Gain - device will use either EMGain or MCPGain
1510 name = "gain"
1511 getter, setter, vrange = None, None, None
1512 if self._caps.ulGetFunctions & AC_GETFUNCTION_EMCCDGAIN:
1513 getter = self._bind(GetEMCCDGain)
1514 elif self._caps.ulGetFunctions & AC_GETFUNCTION_MCPGAIN:
1515 getter = self._bind(GetMCPGain)
1516 if self._caps.ulSetFunctions & AC_SETFUNCTION_EMCCDGAIN:
1517 setter = self._bind(SetEMCCDGain)
1518 vrange = self._bind(GetEMGainRange)
1519 elif self._caps.ulSetFunctions & AC_SETFUNCTION_MCPGAIN:
1520 setter = self._bind(SetMCPGain)
1521 vrange = self._bind(GetMCPGainRange)
1522 if getter or setter:
1523 self.add_setting(name, "int", getter, setter, vrange)
1524 # Temperature
1525 name = "TemperatureSetPoint"
1526 getter, setter, vrange = None, None, None
1527 if self._caps.ulSetFunctions & AC_SETFUNCTION_TEMPERATURE:
1528 setter = self._bind(SetTemperature)
1529 if self._caps.ulGetFunctions & AC_GETFUNCTION_TEMPERATURERANGE:
1530 vrange = self._bind(GetTemperatureRange)
1531 if setter:
1532 self.add_setting(name, "int", None, setter, vrange)
1533 # Set a conservative default temperature set-point.
1534 self.set_setting(name, -20)
1535 # Fan control
1536 name = "Temperature"
1537 self.add_setting(
1538 name, "int", self._get_sensor_temperature, None, (None, None)
1539 )
1540 name = "Fan mode"
1541 self.add_setting(
1542 name,
1543 "enum",
1544 None, # Can't query fan mode
1545 self._bind(SetFanMode),
1546 {0: "full", 1: "low", 2: "off"},
1547 )
1548 # Cooler control
1549 name = "Cooler Enabled"
1550 self.add_setting(name, "bool", None, self._set_cooler_state, None)
1551 self.set_setting(name, True)
1552 # Binning
1553 name = "Binning"
1554 self.add_setting(
1555 name, "tuple", self.get_binning, self.set_binning, None
1556 )
1557 # Roi
1558 name = "Roi"
1559 self.add_setting(
1560 name, "tuple", self.get_roi, lambda roi: self.set_roi(*roi), None
1561 )
1562 # BaselineClamp
1563 name = "BaselineClamp"
1564 if self._caps.ulSetFunctions & AC_SETFUNCTION_BASELINECLAMP:
1565 self.add_setting(
1566 name, "bool", None, self._bind(SetBaselineClamp), None
1567 )
1568 self.set_setting(name, False)
1569 # BaselineOffset
1570 name = "BaselineOffset"
1571 if self._caps.ulSetFunctions & AC_SETFUNCTION_BASELINEOFFSET:
1572 self.add_setting(
1573 name, "int", None, self._bind(SetBaselineOffset), (-1000, 1000)
1574 )
1575 self.set_setting(name, 0)
1576 # EMAdvanced
1577 name = "EMAdvanced"
1578 if self._caps.ulSetFunctions & AC_SETFUNCTION_EMADVANCED:
1579 self.add_setting(
1580 name, "bool", None, self._bind(SetEMAdvanced), None
1581 )
1582 self.set_setting(name, False)
1583 # GateMode
1584 name = "GateMode"
1585 if self._caps.ulSetFunctions & AC_SETFUNCTION_GATEMODE:
1586 vrange = range(
1587 0, [5, 6][self._caps.ulCameraType & AC_CAMERATYPE_ISTAR]
1588 )
1589 self.add_setting(
1590 name, "int", None, self._bind(SetGateMode), vrange
1591 )
1592 # HighCapacity
1593 name = "HighCapacity"
1594 if self._caps.ulSetFunctions & AC_SETFUNCTION_HIGHCAPACITY:
1595 self.add_setting(
1596 name, "bool", None, self._bind(SetHighCapacity), None
1597 )
1598

◆ set_exposure_time()

microscope.cameras.atmcd.AndorAtmcd.set_exposure_time ( self,
value )
Set exposure time.

Reimplemented from microscope.abc.Camera.

Definition at line 1706 of file atmcd.py.

1706 def set_exposure_time(self, value):
1707 """Set exposure time."""
1708 with self:
1709 SetExposureTime(value)
1710

◆ set_trigger()

None microscope.cameras.atmcd.AndorAtmcd.set_trigger ( self,
microscope.TriggerType ttype,
microscope.TriggerMode tmode )
Set device for a specific trigger.

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 1768 of file atmcd.py.

1770 ) -> None:
1771 try:
1772 atmcd_mode = TRIGGER_TO_ATMCD_MODE[(ttype, tmode)]
1773 except KeyError:
1775 "no ATMCD mode for %s and %s" % (ttype, tmode)
1776 )
1777 self.set_setting("TriggerMode", atmcd_mode)
1778

◆ soft_trigger()

microscope.cameras.atmcd.AndorAtmcd.soft_trigger ( self)
Send a software trigger signal.

Deprecated, use trigger().

Definition at line 1752 of file atmcd.py.

1752 def soft_trigger(self):
1753 """Send a software trigger signal.
1754
1755 Deprecated, use trigger().
1756 """
1757 with self:
1758 SendSoftwareTrigger()
1759

◆ trigger_mode()

microscope.TriggerMode microscope.cameras.atmcd.AndorAtmcd.trigger_mode ( self)

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 1761 of file atmcd.py.

1761 def trigger_mode(self) -> microscope.TriggerMode:
1762 return ATMCD_MODE_TO_TRIGGER[self.get_setting("TriggerMode")][1]
1763

◆ trigger_type()

microscope.TriggerType microscope.cameras.atmcd.AndorAtmcd.trigger_type ( self)

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 1765 of file atmcd.py.

1765 def trigger_type(self) -> microscope.TriggerType:
1766 return ATMCD_MODE_TO_TRIGGER[self.get_setting("TriggerMode")][0]
1767

Member Data Documentation

◆ _acquiring

microscope.cameras.atmcd.AndorAtmcd._acquiring
protected

Definition at line 1656 of file atmcd.py.

◆ _binning

microscope.cameras.atmcd.AndorAtmcd._binning = None
protected

Definition at line 1378 of file atmcd.py.

◆ _caps

microscope.cameras.atmcd.AndorAtmcd._caps = GetCapabilities()
protected

Definition at line 1464 of file atmcd.py.

◆ _get_sensor_temperature

microscope.cameras.atmcd.AndorAtmcd._get_sensor_temperature
protected

Definition at line 1538 of file atmcd.py.

◆ _handle

microscope.cameras.atmcd.AndorAtmcd._handle = None
protected

Definition at line 1375 of file atmcd.py.

◆ _rdepth

int microscope.cameras.atmcd.AndorAtmcd._rdepth = 0
protected

Definition at line 1373 of file atmcd.py.

◆ _readout_modes

list microscope.cameras.atmcd.AndorAtmcd._readout_modes = []
protected

Definition at line 1479 of file atmcd.py.

◆ _roi

microscope.cameras.atmcd.AndorAtmcd._roi = None
protected

Definition at line 1377 of file atmcd.py.

◆ _set_cooler_state

microscope.cameras.atmcd.AndorAtmcd._set_cooler_state
protected

Definition at line 1550 of file atmcd.py.

◆ _set_readout_mode

microscope.cameras.atmcd.AndorAtmcd._set_readout_mode
protected

Definition at line 1496 of file atmcd.py.

◆ amplifiers

microscope.cameras.atmcd.AndorAtmcd.amplifiers
Initial value:
= IntEnum(
"Amplifiers",
(("CONVENTIONAL", 0), ("EXTENDED_NIR", 1)),
)

Definition at line 1470 of file atmcd.py.

◆ get_binning

microscope.cameras.atmcd.AndorAtmcd.get_binning = "Binning"

Definition at line 1555 of file atmcd.py.

◆ get_roi

microscope.cameras.atmcd.AndorAtmcd.get_roi = "Roi"

Definition at line 1560 of file atmcd.py.

◆ set_binning

microscope.cameras.atmcd.AndorAtmcd.set_binning

Definition at line 1555 of file atmcd.py.


The documentation for this class was generated from the following file: