Cameras.FLIRPySpin.FLIRPySpinClass

class Cameras.FLIRPySpin.FLIRPySpinClass(cameraNumber, triggerMode=0, exposurems=1, gaindB=1, camROI=None, loadDefault=False)[source]

Bases: CameraClass

Parent class for FLIR cameras using PySpin python driver.

Used as generic driver class if no model-specific child class is defined in same file below

__init__(cameraNumber, triggerMode=0, exposurems=1, gaindB=1, camROI=None, loadDefault=False)[source]

Initialize the Camera object

Parameters:

cameraNumber (int) – index of camera in camerasConfigs list

Keyword Arguments:
  • triggerMode=0 (int) – 0 for hardware/external, 1 for software/internal

  • exposurems=1. (float) – Exposition duration (exposure) in ms.

  • gaindB=0. (float) – hardware gain of the camera in dB.

  • camROI=None (None or [int]*4) – Camera region of interest to read from sensor [x offset , y offset , x size , y size ] (binning is not implemented)

  • True (loadDefault =) – Decide if default values from cameraConfigs should be set at creation

Returns:

FLIRPySpinClass camera object

Methods

__init__(cameraNumber[, triggerMode, ...])

Initialize the Camera object

clearBuffer()

Clear camera buffer from images.

exposureLevelAutoAdjust([attemptsMax, ...])

Automatic adjustment of exposure for setting image 'Max' or 'Average' to a given level.

grabArray()

Get an image from the camera.

roundCamROI([ROI])

Rounding of ROI values to closest possible one according to camera rules

sendSoftwareTrigger()

Send a software trigger to the camera to start an exposure

setCamROI([ROI])

Set the ROI of camera (without binning)

setExposurems(exposurems)

Set the duration of the exposition

setGaindB(gaindB)

Set the hardware gain of camera readout

setTriggerMode(triggerMode)

Set the trigger mode

startAcquisition()

Start acquisition or restart if already running

__del__()[source]

Delete the Camera object by calling close function

Close the Camera and free memory

clearBuffer()[source]

Clear camera buffer from images. Use before imaging scans to make sure no previously acquired image is present in buffer

grabArray()[source]

Get an image from the camera. Wait for trigger if external or generate one if internal.

Returns:

Camera image (numpy 2D array)

roundCamROI(ROI=None)[source]

Rounding of ROI values to closest possible one according to camera rules

Keyword Arguments:

None (ROI =) – [# x offset, y offset, x size, y size] if None, set to [0, 0, max Width, max height]

Returns:

[ x offset, y offset, x size, y size]

Return type:

Camera ROI ([int]*4)

sendSoftwareTrigger()[source]

Send a software trigger to the camera to start an exposure

setCamROI(ROI=None)[source]

Set the ROI of camera (without binning)

Keyword Arguments:

None (ROI =) – [ x offset, y offset, x size, y size] if None, set to [0, 0, max Width, max height]

Returns:

[ x offset, y offset, x size, y size]

Return type:

Camera ROI ([int]*4)

setExposurems(exposurems)[source]

Set the duration of the exposition

Parameters:

exposurems (float) – Exposition duration (exposure) in ms.

setGaindB(gaindB)[source]

Set the hardware gain of camera readout

Parameters:

gaindB (float) – hardware gain of the camera in dB.

setTriggerMode(triggerMode)[source]

Set the trigger mode

Parameters:

triggerMode (int) – 0 for hardware/external, 1 for software/internal

startAcquisition()[source]

Start acquisition or restart if already running