Base Camera Model

Camera class with the base methods. Having a base class exposes the general API for working with cameras. This file is important to keep track of the methods which are exposed to the View. The class BaseCamera should be subclassed when developing new Models for other cameras. This ensures that all the methods are automatically inherited and there are no breaks downstream.

Conventions

Images are 0-indexed. Therefore, a camera with 1024pxx1024px will be used as img[0:1024, 0:1024] (remember Python leaves out the last value in the slice.

Region of Interest is specified with the coordinates of the corners. A full-frame with the example above would be given by X=[0,1023], Y=[0,1023]. Be careful, since the maximum width (or height) of the camera is 1024.

The camera keeps track of the coordinates of the initial pixel. For full-frame, this will always be [0,0]. When this is very important for the GUI, since after the first crop, if the user wants to crop even further, the information has to be referenced to the already cropped area.

Note

IMPORTANT Whatever new function is implemented in a specific model, it should be first declared in the BaseCamera class. In this way the other models will have access to the method and the program will keep running (perhaps with non intended behavior though).

copyright

Aquiles Carattino <aquiles@uetke.com>

license

GPLv3, see LICENSE for more details

class pynta.model.cameras.base_camera.BaseCamera(camera)[source]

Bases: object

ACQUISITION_MODE = {0: 'Single', 1: 'Continuous'}
GetCCDHeight()[source]

Returns: the CCD height in pixels

GetCCDWidth()[source]

Returns the CCD width in pixels

MODE_CONTINUOUS = 1
MODE_SINGLE_SHOT = 0
acquisition_ready()[source]

Checks if the acquisition in the camera is over.

clear_ROI()[source]

Clears the ROI from the camera.

clear_binning()[source]

Clears the binning of the camera to its default value.

configure(properties: dict)[source]
getSerialNumber()[source]

Returns the serial number of the camera.

get_acquisition_mode()[source]

Returns the acquisition mode, either continuous or single shot.

get_exposure()[source]

Gets the exposure time of the camera.

get_size()[source]

Returns the size in pixels of the image being acquired. This is useful for checking the ROI settings.

initialize()[source]

Initializes the camera.

read_camera()[source]

Reads the camera

set_ROI(X, Y)[source]

Sets up the ROI. Not all cameras are 0-indexed, so this is an important place to define the proper ROI.

Parameters
  • X (list) – array type with the coordinates for the ROI X[0], X[1]

  • Y (list) – array type with the coordinates for the ROI Y[0], Y[1]

Returns

X, Y lists with the current ROI information

set_acquisition_mode(mode)[source]

Set the readout mode of the camera: Single or continuous. :param int mode: One of self.MODE_CONTINUOUS, self.MODE_SINGLE_SHOT :return:

set_binning(xbin, ybin)[source]

Sets the binning of the camera if supported. Has to check if binning in X/Y can be different or not, etc.

Parameters
  • xbin

  • ybin

Returns

set_exposure(exposure)[source]

Sets the exposure of the camera.

stopAcq()[source]

Stops the acquisition without closing the connection to the camera.

stop_camera()[source]

Stops the acquisition and closes the connection with the camera.

trigger_camera()[source]

Triggers the camera.