microscope.cameras.atmcd module

atmcd

This module wraps Andor’s SDK for (EM)CCD cameras.

Example deviceserver entry:

from microscope.cameras import atmcd DEVICES = [ …

device(atmcd.AndorAtmcd, ‘127.0.0.1’, 8000, uid=’VSC-01234’)

]

Tested against Ixon Ultra with atmcd64d.dll ver 2.97.30007.0 .

class microscope.cameras.atmcd.ANDORCAPS[source]

Bases: _ctypes.Structure

ulAcqModes

Structure/Union member

ulCameraType

Structure/Union member

ulEMGainCapability

Structure/Union member

ulFTReadModes

Structure/Union member

ulFeatures

Structure/Union member

ulGetFunctions

Structure/Union member

ulPCICard

Structure/Union member

ulPixelMode

Structure/Union member

ulReadModes

Structure/Union member

ulSetFunctions

Structure/Union member

ulSize

Structure/Union member

ulTriggerModes

Structure/Union member

microscope.cameras.atmcd.AT_CONTROLLER_CARD_MODEL_LEN = 80

DDG Lite Definitions

class microscope.cameras.atmcd.AT_DDGLiteChannelId[source]

Bases: ctypes.c_int

microscope.cameras.atmcd.AT_DDGLite_ControlBit_EnableOnFire = 32

USB iStar Definitions

microscope.cameras.atmcd.AT_GATEMODE_DDG = 5

typedef structs

class microscope.cameras.atmcd.AT_VersionInfoId[source]

Bases: ctypes.c_int

class microscope.cameras.atmcd.AcquisitionMode[source]

Bases: enum.IntEnum

Acquisition modes.

ACCUMULATE = 2
FASTKINETICS = 4
KINETICS = 3
RUNTILLABORT = 5
SINGLE = 1
class microscope.cameras.atmcd.AndorAtmcd(index=0, **kwargs)[source]

Bases: microscope.devices.FloatingDeviceMixin, microscope.devices.CameraDevice

Implements CameraDevice interface for Andor ATMCD library.

__enter__()[source]

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.

__exit__(exc_type, exc_value, traceback)[source]

Context manager exit code.

_bind(fn)[source]

Binds unbound SDK functions to this camera.

_fetch_data()[source]

Poll for data and return it, with minimal processing.

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

_get_binning()[source]

Return the binning setting.

_get_roi()[source]

Return the current ROI setting.

_get_sensor_shape()[source]

Return the sensor geometry.

_on_disable()[source]

Call abort to stop acquisition.

_on_enable()[source]

Enter data acquisition state.

_on_shutdown()[source]

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.

_set_cooler_state(state)[source]

Turn the sensor cooler on (True) or off (False)

_set_image()[source]

Set ROI and binning prior to acquisition.

_set_readout_mode(mode_index)[source]

Configure channel, amplifier and VS-speed.

abort()[source]

Abort acquisition.

get_cycle_time()[source]

Determine the minimum time between exposures.

get_exposure_time()[source]

Query the actual exposure time.

get_id()[source]

Return the device’s unique identifier.

get_sensor_temperature()[source]

Return the sensor temperature.

get_trigger_type()[source]

Return the microscope.devices trigger type.

initialize()[source]

Initialize the library and hardware and create Setting objects.

set_exposure_time(*args, **kwargs)
soft_trigger()[source]

Send a software trigger signal.

microscope.cameras.atmcd.AndorCapabilities

alias of microscope.cameras.atmcd.ANDORCAPS

exception microscope.cameras.atmcd.AtmcdException(status)[source]

Bases: Exception

An exception arising from a DLL call.

class microscope.cameras.atmcd.COLORDEMOSAICINFO[source]

Bases: _ctypes.Structure

iAlgorithm

Structure/Union member

iBackground

Structure/Union member

iX

Structure/Union member

iXPhase

Structure/Union member

iY

Structure/Union member

iYPhase

Structure/Union member

microscope.cameras.atmcd.ColorDemosaicInfo

alias of microscope.cameras.atmcd.COLORDEMOSAICINFO

class microscope.cameras.atmcd.OUTARR(val)[source]

Bases: microscope.cameras.atmcd.OUTPUT

Used for DLL call parameters that return an array.

getVar(size)[source]
class microscope.cameras.atmcd.OUTPUT(val)[source]

Bases: microscope.cameras.atmcd._meta

Used to indicated output from a DLL call

getVar(bufLen=0)[source]
class microscope.cameras.atmcd.ReadMode[source]

Bases: enum.IntEnum

Chip readout modes. Currently, only IMAGE is supported.

FULLVERTICALBINNING = 0
IMAGE = 4
MULTITRACK = 1
RANDOMTRACK = 2
SINGLETRACK = 3
class microscope.cameras.atmcd.ReadoutMode(channel, amplifier, hs_index, speed)[source]

Bases: object

A combination of channel, amplifier and speed settings.

class microscope.cameras.atmcd.SYSTEMTIME[source]

Bases: _ctypes.Structure

wDay

Structure/Union member

wDayOfWeek

Structure/Union member

wHour

Structure/Union member

wMilliseconds

Structure/Union member

wMinute

Structure/Union member

wMonth

Structure/Union member

wSecond

Structure/Union member

wYear

Structure/Union member

class microscope.cameras.atmcd.TriggerMode[source]

Bases: enum.IntEnum

Camera trigger modes

BULB = 7
EXTERNAL = 1
EXT_FVB = 9
EXT_START = 6
INTERNAL = 0
SOFTWARE = 10
class microscope.cameras.atmcd.WHITEBALANCEINFO[source]

Bases: _ctypes.Structure

iAlgorithm

Structure/Union member

iOperation

Structure/Union member

iROI_bottom

Structure/Union member

iROI_left

Structure/Union member

iROI_right

Structure/Union member

iROI_top

Structure/Union member

iSize

Structure/Union member

iX

Structure/Union member

iY

Structure/Union member

microscope.cameras.atmcd.WhiteBalanceInfo

Enums

alias of microscope.cameras.atmcd.WHITEBALANCEINFO

class microscope.cameras.atmcd._OUTARRSIZE[source]

Bases: microscope.cameras.atmcd._meta

Used to mark DLL call parameters that define array sizes.

class microscope.cameras.atmcd._OUTSTRING[source]

Bases: microscope.cameras.atmcd.OUTPUT

A special type of OUTPUT that creates an output buffer.

getVar(bufLen)[source]
class microscope.cameras.atmcd._OUTSTRLEN[source]

Bases: microscope.cameras.atmcd._meta

Used to mark call parameters that define a string buffer size.

microscope.cameras.atmcd.at_u64

alias of ctypes.c_ulong

microscope.cameras.atmcd.dllFunc(name, args=[], argnames=[], rstatus=False, lib=<MagicMock id='139821597995192'>)[source]

Wrap library calls and add them to this module’s namespace.

class microscope.cameras.atmcd.dllFunction(name, args=[], argnames=[], rstatus=False, lib=<MagicMock id='139821597995192'>)[source]

Bases: object

A wrapper class for DLL functions to make them available in python.

__call__(*args)[source]

Parse arguments, allocate any required storage, and execute the call.

microscope.cameras.atmcd.extract_value(val)[source]

Calls .value on simple ctypes.

microscope.cameras.atmcd.lookup_status(code)[source]
microscope.cameras.atmcd.stripMeta(val)[source]

Strips the outer metaclass to give the underlying data object.