Skip to content

Ax8

This module contains the AX8 camera class

ATTRIBUTE DESCRIPTION
BYTE_SIZE

size of data packet

TYPE: int

MODBUS_PORT

Modbus port

TYPE: int

CLASS DESCRIPTION
AX8

AX8 camera class

Documentation last updated: 2025-02-22

AX8

AX8(
    host: str,
    *,
    port: int = MODBUS_PORT,
    encoding: str = "avc",
    overlay: bool = False,
    connection_details: dict | None = None,
    init_timeout: int = 1,
    simulation: bool = False,
    verbose: bool = False,
    **kwargs,
)

Bases: Camera

AX8 camera class

ATTRIBUTE DESCRIPTION
host

camera IP address

TYPE: str

port

Modbus port

TYPE: int

modbus

Modbus connection

TYPE: ModbusClient

connection

Modbus connection

TYPE: ModbusClient

spotmeter_parameters

spotmeter parameters

TYPE: dict

METHOD DESCRIPTION
checkDeviceConnection

check if the camera and feed are connected

connect

connect to camera and feed

connectCamera

connect to camera

connectFeed

connect to feed

disconnect

disconnect from camera and feed

disconnectCamera

disconnect from camera

disconnectFeed

disconnect from feed

configureSpotmeter

set the temperature calculation parameters when enabling a spotmeter

disableSpotmeter

disable spotmeters with given instance IDs

enableSpotmeter

enable spotmeters with given instance IDs

getCutline

get a 1D array of temperature values along the given cutline

getInternalTemperature

get the internal temperature of the camera

getSpotPositions

get the positions for specified spotmeters

getSpotTemperatures

get temperature readings for specified spotmeters

invertPalette

invert the palette of the feed

decodeModbus

parse values from reading modbus holding registers

encodeModbus

format value to create data packet

Initialize the AX8 object

PARAMETER DESCRIPTION
host

camera IP address

TYPE: str

port

Modbus port. Defaults to 502.

TYPE: int DEFAULT: MODBUS_PORT

encoding

feed encoding. Defaults to 'avc'.

TYPE: str DEFAULT: 'avc'

overlay

whether to overlay data. Defaults to False.

TYPE: bool DEFAULT: False

connection_details

connection details. Defaults to None.

TYPE: dict DEFAULT: None

init_timeout

initial timeout. Defaults to 1.

TYPE: int DEFAULT: 1

simulation

whether to simulate the camera. Defaults to False.

TYPE: bool DEFAULT: False

verbose

whether to print debug messages. Defaults to False.

TYPE: bool DEFAULT: False

host property writable

host: str

Camera IP address

modbus property writable

modbus: ModbusClient

Modbus connection

port property writable

port: int

Modbus port

configureSpotmeter

configureSpotmeter(
    reflected_temperature: float | None = None,
    emissivity: float | None = None,
    distance: float | None = None,
)

Set the temperature calculation parameters when enabling a spotmeter

PARAMETER DESCRIPTION
reflected_temperature

reflected temperature in Kelvin. Defaults to None.

TYPE: float | None DEFAULT: None

emissivity

emissivity between 0.001 and 1. Defaults to None.

TYPE: float | None DEFAULT: None

distance

distance in metres, at least 0.2. Defaults to None.

TYPE: float | None DEFAULT: None

connectCamera

connectCamera()

Connect to camera

decodeModbus staticmethod

decodeModbus(data: Sequence[int], is_int: bool) -> tuple

Parse values from reading modbus holding registers

PARAMETER DESCRIPTION
data

data packet

TYPE: list[int]

is_int

whether the expected value is an integer (as opposed to a float)

TYPE: bool

RETURNS DESCRIPTION
tuple

unpacked values

TYPE: tuple

disableSpotmeter

disableSpotmeter(instances: list)

Disable spotmeters with given instance IDs

PARAMETER DESCRIPTION
instances

list of instance IDs

TYPE: list

disconnectCamera

disconnectCamera()

Disconnect from camera

enableSpotmeter

enableSpotmeter(
    instances: dict[int, tuple[int, int]],
    use_local_params: bool = True,
)

Enable spotmeters with given instance IDs, for up to 5 individual spotmeters Spotmeter position range is from (2,2) to (78,58). The lower left corner is pixel (2,58).

PARAMETER DESCRIPTION
instances

dictionary of instance and position tuples, {instance_id: (spot_x, spot_y)}

TYPE: dict[int, tuple[int, int]]

use_local_params

Each spotmeter can use its own set of local parameters. If set to false, the global parameters will be used by the camera. Defaults to True.

TYPE: bool DEFAULT: True

encodeModbus staticmethod

encodeModbus(value: bool | float | int) -> list[int]

Format value to create data packet

PARAMETER DESCRIPTION
value

target value

TYPE: Union[bool, float, int]

RETURNS DESCRIPTION
list[int]

list[int]: data packet

getCutline

getCutline(
    x: int | None = None,
    y: int | None = None,
    unit_celsius: bool = True,
    reflected_temperature: float | None = None,
    emissivity: float | None = None,
    distance: float | None = None,
) -> ndarray | None

Get a 1D array of temperature values along the given cutline, either along given X or Y

PARAMETER DESCRIPTION
x

cutline position along X. Defaults to None.

TYPE: Optional[int] DEFAULT: None

y

cutline position along Y. Defaults to None.

TYPE: Optional[int] DEFAULT: None

unit_celsius

whether to return the temperatures in Celsius. Defaults to True.

TYPE: bool DEFAULT: True

reflected_temperature

reflected temperature in Kelvin. Defaults to None.

TYPE: float | None DEFAULT: None

emissivity

emissivity between 0.001 and 1. Defaults to None.

TYPE: float | None DEFAULT: None

distance

distance in metres, at least 0.2. Defaults to None.

TYPE: float | None DEFAULT: None

RETURNS DESCRIPTION
ndarray | None

np.ndarray|None: array of temperature values along cutline

getInternalTemperature

getInternalTemperature() -> float

Get the internal temperature of the camera

RETURNS DESCRIPTION
float

internal temperature in Kelvin

TYPE: float

getSpotPositions

getSpotPositions(
    instances: list,
) -> dict[int, tuple[int, int]]

Get the positions for specified spotmeters

PARAMETER DESCRIPTION
instances

list of instance IDs

TYPE: list

RETURNS DESCRIPTION
dict[int, tuple[int, int]]

dict[int, tuple[int,int]]: dictionary of spotmeter positions, {instance_id: (spot_x, spot_y)}

getSpotTemperatures

getSpotTemperatures(
    instances: list, unit_celsius: bool = True
) -> dict[int, float]

Get temperature readings for specified spotmeters

PARAMETER DESCRIPTION
instances

list of instance IDs

TYPE: list

unit_celsius

whether to return the temperatures in Celsius. Defaults to True.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
dict[int, float]

dict[int, float]: dictionary of spotmeter temperatures, {instance_id: temperature}

invertPalette

invertPalette(blue_cold: bool = True)

Invert the palette of the feed

PARAMETER DESCRIPTION
blue_cold

whether to set the palette to blue cold. Defaults to True.

TYPE: bool DEFAULT: True