Ax8
This module contains the AX8 camera class
ATTRIBUTE | DESCRIPTION |
---|---|
BYTE_SIZE |
size of data packet
TYPE:
|
MODBUS_PORT |
Modbus port
TYPE:
|
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:
|
port |
Modbus port
TYPE:
|
modbus |
Modbus connection
TYPE:
|
connection |
Modbus connection
TYPE:
|
spotmeter_parameters |
spotmeter parameters
TYPE:
|
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:
|
port
|
Modbus port. Defaults to 502.
TYPE:
|
encoding
|
feed encoding. Defaults to 'avc'.
TYPE:
|
overlay
|
whether to overlay data. Defaults to False.
TYPE:
|
connection_details
|
connection details. Defaults to None.
TYPE:
|
init_timeout
|
initial timeout. Defaults to 1.
TYPE:
|
simulation
|
whether to simulate the camera. Defaults to False.
TYPE:
|
verbose
|
whether to print debug messages. Defaults to False.
TYPE:
|
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:
|
emissivity
|
emissivity between 0.001 and 1. Defaults to None.
TYPE:
|
distance
|
distance in metres, at least 0.2. Defaults to None.
TYPE:
|
decodeModbus
staticmethod
Parse values from reading modbus holding registers
PARAMETER | DESCRIPTION |
---|---|
data
|
data packet
TYPE:
|
is_int
|
whether the expected value is an integer (as opposed to a float)
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple
|
unpacked values
TYPE:
|
disableSpotmeter
Disable spotmeters with given instance IDs
PARAMETER | DESCRIPTION |
---|---|
instances
|
list of instance IDs
TYPE:
|
enableSpotmeter
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:
|
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:
|
encodeModbus
staticmethod
Format value to create data packet
PARAMETER | DESCRIPTION |
---|---|
value
|
target value
TYPE:
|
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:
|
y
|
cutline position along Y. Defaults to None.
TYPE:
|
unit_celsius
|
whether to return the temperatures in Celsius. Defaults to True.
TYPE:
|
reflected_temperature
|
reflected temperature in Kelvin. Defaults to None.
TYPE:
|
emissivity
|
emissivity between 0.001 and 1. Defaults to None.
TYPE:
|
distance
|
distance in metres, at least 0.2. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ndarray | None
|
np.ndarray|None: array of temperature values along cutline |
getInternalTemperature
Get the internal temperature of the camera
RETURNS | DESCRIPTION |
---|---|
float
|
internal temperature in Kelvin
TYPE:
|
getSpotPositions
Get the positions for specified spotmeters
PARAMETER | DESCRIPTION |
---|---|
instances
|
list of instance IDs
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[int, tuple[int, int]]
|
dict[int, tuple[int,int]]: dictionary of spotmeter positions, {instance_id: (spot_x, spot_y)} |
getSpotTemperatures
Get temperature readings for specified spotmeters
PARAMETER | DESCRIPTION |
---|---|
instances
|
list of instance IDs
TYPE:
|
unit_celsius
|
whether to return the temperatures in Celsius. Defaults to True.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[int, float]
|
dict[int, float]: dictionary of spotmeter temperatures, {instance_id: temperature} |