microspeclib.datatypes.sensor module (dev-kit API responses)

class microspeclib.datatypes.sensor.SensorAutoExposure(*args, status=None, success=None, iterations=None, **kwargs)

Contains result of command autoExposure().

status
0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

Type

MicroSpecInteger

success
1: SUCCESS

The peak signal is in the target counts range.

0: FAILURE

The peak signal is not in the target counts range. Fail for any of the following reasons:

  • reached the maximum number of tries

  • hit maximum exposure time and signal is below target range

  • hit minimum exposure time and signal is above target range

Type

MicroSpecInteger

iterations

Number of exposures tried by auto-expose. Valid range: 1-255

iterations never exceeds setAutoExposeConfig() parameter max_tries, the maximum number of iterations to try.

Type

MicroSpecInteger

class microspeclib.datatypes.sensor.SensorCaptureFrame(*args, status=None, num_pixels=None, pixels=None, **kwargs)

Contains result of command captureFrame().

status
0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

Type

MicroSpecInteger

num_pixels

Number of pixels to expect in the pixels parameter.

  • expect 392 pixels when pixel binning is ON

    • ON is the default value in firmware after dev-kit power-on

  • expect 784 pixels when pixel binning is OFF

Type

MicroSpecInteger

pixels

Counts (signal strength) at each pixel. Pixel counts are in the range 0-65535.

Type

list

class microspeclib.datatypes.sensor.SensorGetAutoExposeConfig(*args, status=None, max_tries=None, start_pixel=None, stop_pixel=None, target=None, target_tolerance=None, max_exposure=None, **kwargs)

Contains result of command getAutoExposeConfig().

status
0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

Type

MicroSpecInteger

max_tries

Maximum number of exposures to try before auto-expose gives up.

  • Valid range: 1-255

  • Default (after dev-kit power-on): 12

Type

MicroSpecInteger

start_pixel

Auto-expose does not use pixels below start_pixel.

  • Valid range: 1-392 (1-784 with pixel binning off)

  • Default (after dev-kit power-on): 7

Type

MicroSpecInteger

stop_pixel

Auto-expose does not use pixels above stop_pixel.

  • Valid range: 1-392 (1-784 with pixel binning off)

  • Default (after dev-kit power-on): 392

Type

MicroSpecInteger

target

Auto-expose target peak counts.

  • Valid range: 4500-65535

  • Default (after dev-kit power-on): 46420

Type

MicroSpecInteger

target_tolerance

Tolerance for hitting the auto-expose target. Auto-expose hits its target if the peak counts is in the range target +/- target_tolerance.

  • Valid range: 0-65535

  • Default (after dev-kit power-on): 3277

Type

MicroSpecInteger

max_exposure

The maximum integration time (exposure time) auto-expose is allowed to try. Auto-expose gives up if the exposure time is max_exposure and the peak counts is below the target range.

  • Valid range: 5-65535 (0.1ms to 1.3s)

  • Default (after dev-kit power-on): 10000 (200ms)

Type

MicroSpecInteger

class microspeclib.datatypes.sensor.SensorGetExposure(*args, status=None, cycles=None, **kwargs)

Contains result of command getExposure.

Parameters
  • status (MicroSpecInteger) –

    0: StatusOK

    The dev-kit successfully executed the command.

    1: StatusError

    The dev-kit failed to execute the command for one of the following reasons:

    • serial communication failed

    • the command is invalid

    • one or more command parameters are invalid

    If status is StatusError the other attributes are not valid.

  • cycles (int) –

    Exposure time in units of 20µs cycles. For example, a 1ms exposure time is 50 cycles.

    • Valid range: 5-65535 (0.1ms to 1.3s)

    • Default (after dev-kit power-on): 50 (1ms)

class microspeclib.datatypes.sensor.SensorGetSensorConfig(*args, status=None, binning=None, gain=None, row_bitmap=None, **kwargs)

Contains result of command getSensorConfig().

status
0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

Type

MicroSpecInteger

num_pixels

Number of pixels to expect in the pixels parameter.

  • expect 392 pixels when pixel binning is ON

    • ON is the default value in firmware after dev-kit power-on

  • expect 784 pixels when pixel binning is OFF

Type

MicroSpecInteger

pixels

Counts (signal strength) at each pixel. Pixel counts are in the range 0-65535.

Type

list

class microspeclib.datatypes.sensor.SensorGetSensorLED(*args, status=None, led_setting=None, **kwargs)

Contains result of command getSensorLED().

status
0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

Type

MicroSpecInteger

led_num

Which LED the setting applies to. Valid range: 0, 1

Type

MicroSpecInteger

led_setting

State of the LED: LEDOff, LEDGreen, or LEDRed

Type

MicroSpecInteger

class microspeclib.datatypes.sensor.SensorSetAutoExposeConfig(*args, status=None, **kwargs)

Contains result of command setAutoExposeConfig().

status
0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

Type

MicroSpecInteger

class microspeclib.datatypes.sensor.SensorSetExposure(*args, status=None, **kwargs)

Contains the result of a CommandSetExposure command.

Parameters

status (MicroSpecInteger) –

0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

class microspeclib.datatypes.sensor.SensorSetSensorConfig(*args, status=None, **kwargs)

Contains the result of a CommandSetSensorConfig command.

Parameters

status (MicroSpecInteger) –

0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

class microspeclib.datatypes.sensor.SensorSetSensorLED(*args, status=None, **kwargs)

Contains the status of the CommandSetSensorLED command.

Parameters

status (MicroSpecInteger) –

0: StatusOK

The dev-kit successfully executed the command.

1: StatusError

The dev-kit failed to execute the command for one of the following reasons:

  • serial communication failed

  • the command is invalid

  • one or more command parameters are invalid

If status is StatusError the other attributes are not valid.

microspeclib.datatypes.sensor.getSensorReplyByID(cid)
microspeclib.datatypes.sensor.getSensorReplyByName(name)