Basler Camera Model

Model to adapt PyPylon to the needs of PyNTA. PyPylon is only a wrapper for Pylon, thus the documentation has to be found in the folder where Pylon was installed. It refers only to the C++ documentation, which is very extensive, but not necessarily clear.

Some assumptions

The program forces software trigger during initialize().

class pynta.model.cameras.basler.Camera(camera)[source]

Bases: pynta.model.cameras.base_camera.BaseCamera

GetCCDHeight() → int[source]

Get the full height (in pixels) of the camera sensor.

Return int

Maximum height

Deprecated since version 0.1.3: Use self.max_height instead

GetCCDWidth() → int[source]

Get the full width of the camera sensor.

Return int

Maximum width

Deprecated since version 0.1.3: Use self.max_width instead

clear_ROI()[source]

Resets the ROI to the maximum area of the camera

get_exposure() → pint.quantity.build_quantity_class.<locals>.Quantity[source]

Gets the exposure time of the camera.

get_size() → Tuple[int, int][source]

Get the size of the current Region of Interest (ROI). Remember that the actual size may be different from the size that the user requests, given that not all cameras accept any pixel. For example, Basler has some restrictions regarding corner pixels and possible widths.

Return tuple

(Width, Height)

initialize()[source]

Initializes the communication with the camera. Get’s the maximum and minimum width. It also forces the camera to work on Software Trigger.

Warning

It may be useful to integrate other types of triggers in applications that need to synchronize with other hardware.

read_camera()[source]

Reads the camera

set_ROI(X: Tuple[int, int], Y: Tuple[int, int]) → Tuple[int, int][source]

Set up the region of interest of the camera. Basler calls this the Area of Interest (AOI) in their manuals. Beware that not all cameras allow to set the ROI (especially if they are not area sensors). Both the corner positions and the width/height need to be multiple of 4. Compared to Hamamatsu, Baslers provides a very descriptive error warning.

Parameters
  • X (tuple) – Horizontal limits for the pixels, 0-indexed and including the extremes. You can also check Base Camera To select, for example, the first 100 horizontal pixels, you would supply the following: (0, 99)

  • Y (tuple) – Vertical limits for the pixels.

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_exposure(exposure: pint.quantity.build_quantity_class.<locals>.Quantity) → pint.quantity.build_quantity_class.<locals>.Quantity[source]

Sets the exposure of the camera.

stop_camera()[source]

Stops the acquisition and closes the connection with the camera.

trigger_camera()[source]

Triggers the camera.