LaMcube

Bi Spectral

class crappy.lamcube.BiSpectral[source]

This class allows driving a bi-chromatic infrared camera, through a Basler microEnable 5 Ironman AD8 PoCL acquisition board.

It is a child of the BaslerIronmanCameraLink Camera. It can set various settings on the camera, including the ROI or the trigger mode.

The bi-chromatic camera is a very specific setup, and won’t certainly be ever used outside the LaMcube laboratory. This is why it is stored in the LaMcube submodule.

Warning

This Camera relies on a custom-written C library that hasn’t been tested in a long time. It might not be functional anymore. This Camera also requires proprietary drivers to be installed.

New in version 1.4.0.

Changed in version 2.0.0: renamed from Bispectral to BiSpectral

__init__() None[source]

Adds the various setting for the Camera.

open(camera_type: str = 'SingleAreaGray2DShading', **kwargs) None[source]

Opens the Camera and sends initialization commands.

New in version 1.5.10: explicitly listing camera_type argument

get_image() Tuple[float, ndarray][source]

Grabs an image using the parent class’ method, transforms it, and returns it.

Biaxe

class crappy.lamcube.Biaxe(port: str = '/dev/ttyUSB0', baudrate: int = 38400, timeout: float = 1)[source]

This class can drive a Kollmorgen ServoStar 300 conditioner in speed.

It is used at the LaMcube for driving a bi-axial tensile test machine, hence its name. The ServoStar300 Actuator can drive the same hardware, but only in position.

New in version 1.4.0.

__init__(port: str = '/dev/ttyUSB0', baudrate: int = 38400, timeout: float = 1) None[source]

Sets the instance attributes.

Parameters:
  • port – Path to the serial port to use for communication, e.g ‘/dev/ttyS4’.

  • baudrate – The baud rate for the serial communication.

  • timeout – The timeout for the serial communication.

open() None[source]

Opens the serial connection to the ServoStar.

set_speed(speed: float) None[source]

Sets a displacement speed for the motor. A value of 1 corresponds to 0.002 mm/s

stop() None[source]

Sets the speed of the motor to 0.

New in version 2.0.0.

close() None[source]

Closes the serial connection to the ServoStar.

Biotens

class crappy.lamcube.Biotens(port: str = '/dev/ttyUSB0')[source]

Simply an alias of JVLMac140 for convenience for the users at the LaMcube laboratory.

open() None

Initializes the serial connection and clears any serial error.

get_position() float

Reads and returns the current position of the servomotor, in mm.

Changed in version 1.5.2: renamed from get_pos to get_position

set_speed(speed: float) None

Sets the desired speed on the actuator.

Parameters:

speed – The target speed, in mm/min.

set_position(position: float, speed: float | None) None

Sets the desired target position on the servomotor.

Parameters:
  • position – The target position, in mm.

  • speed

    The target speed for reaching the desired position, in mm/min. The speed must be given, otherwise an exception is raised.

    Changed in version 2.0.0: speed is now a mandatory argument

reset_position() None

Makes the servomotor reach its limit position, in order to re-calibrate the position readout.

stop() None

Sends a command for stopping the servomotor.

close() None

Closes the serial connection to the servomotor.

__init__(port: str = '/dev/ttyUSB0') None

Initializes the parent class.

Parameters:

port – Path to the serial port to use for communication.

Removed in version 2.0.0: baudrate argument