microscope.testsuite.devices module

class microscope.testsuite.devices.CamEnum[source]

Bases: enum.IntEnum

An enumeration.

A = 1
B = 2
C = 3
D = 4
class microscope.testsuite.devices.DummyDSP(**kwargs)[source]

Bases: microscope.devices.Device

Abort()[source]
DownloadProfile()[source]
InitProfile(numReps)[source]
MoveAbsolute(aline, pos)[source]
PrepareActions(actions, numReps=1)[source]
ReadDigital()[source]
ReadPosition(aline)[source]
RunActions()[source]
WriteDigital(value)[source]
arcl(mask, pairs)[source]
initialize()[source]

Initialize the device.

profileSet(pstr, digitals, *analogs)[source]
receiveClient(*args, **kwargs)[source]
set_client(*args, **kwargs)[source]
trigCollect(*args, **kwargs)[source]
class microscope.testsuite.devices.DummySLM(**kwargs)[source]

Bases: microscope.devices.Device

get_sequence_index()[source]
get_sim_diffraction_angle()[source]
get_sim_sequence()[source]
initialize()[source]

Initialize the device.

run()[source]
set_sim_diffraction_angle(theta)[source]
set_sim_sequence(seq)[source]
stop()[source]
class microscope.testsuite.devices.TestCamera(**kwargs)[source]

Bases: microscope.devices.CameraDevice

_create_buffers()[source]

Create buffers and store values needed to remove padding later.

_purge_buffers()[source]

Purge buffers on both camera and PC.

abort()[source]

Stop acquisition as soon as possible.

get_cycle_time()[source]

Return the cycle time, in seconds.

get_exposure_time()[source]

Return the current exposure time, in seconds.

get_trigger_type()[source]

Return the current trigger mode.

One of
TRIGGER_AFTER, TRIGGER_BEFORE or TRIGGER_DURATION (bulb exposure.)
initialize()[source]

Initialise the camera.

Open the connection, connect properties and populate settings dict.

make_safe()[source]

Put the device into a safe state.

set_exposure_time(value)[source]

Set the exposure time on the device.

Parameters:value – exposure time in seconds
soft_trigger()[source]

Optional software trigger - implement if available.

class microscope.testsuite.devices.TestDeformableMirror(n_actuators, **kwargs)[source]

Bases: microscope.devices.DeformableMirror

apply_pattern(pattern)[source]

Apply this pattern.

get_current_pattern()[source]
n_actuators
class microscope.testsuite.devices.TestFilterWheel(**kwargs)[source]

Bases: microscope.devices.FilterWheelBase

get_position()[source]

Return the wheel’s current position

initialize()[source]

Initialize the device.

set_position(position)[source]

Set the wheel position.

class microscope.testsuite.devices.TestLaser(**kwargs)[source]

Bases: microscope.devices.LaserDevice

get_is_on()[source]

Return True if the laser is currently able to produce light.

get_max_power_mw()[source]

Return the max. power in mW.

get_min_power_mw()[source]

Return the min power in mW.

get_power_mw()[source]

“” Return the current power in mW.

get_status()[source]

Query and return the laser status.

initialize()[source]

Initialize the device.

class microscope.testsuite.devices._ImageGenerator[source]

Bases: object

Generates test images, with methods for configuration via a Setting.

black(w, h, dark, light)[source]

Ignores dark and light - returns zeros

data_type()[source]
enable_numbering(enab)[source]
get_data_types()[source]
get_image(width, height, dark=0, light=255, index=None)[source]

Return an image using the currently selected method.

get_methods()[source]

Return the names of available image generation methods

gradient(w, h, dark, light)[source]

A single gradient across the whole image from top left to bottom right.

method()[source]

Return the index of the current image generation method.

noise(w, h, dark, light)[source]

Random noise.

one_gaussian(w, h, dark, light)[source]

A single gaussian

sawtooth(w, h, dark, light)[source]

A sawtooth gradient that rotates about 0,0.

set_data_type(index)[source]
set_method(index)[source]

Set the image generation method.

white(w, h, dark, light)[source]

Ignores dark and light - returns max value for current data type.

microscope.testsuite.devices._theta_generator()[source]

A generator that yields values between 0 and 2*pi

microscope.testsuite.devices.must_be_initialized(f)[source]