Testing with jaeger

class jaeger.testing.MockFPS(*args, **kwargs)[source]

Bases: FPS

A mock of the FPS class.

Implements some basic functionality of the FPS class for testing, mainly meant for testing the Design, Configuration, and path generation routines.

Parameters:
  • observatory (str) – The observatory for which to create the mock FPS.

  • positioner_data (Mapping[int, Mapping[str, float | bool]]) – A mapping of positioner ID to a dictionary of states, which can include the alpha and beta positions, whether it is disabled or offline. The remaining positioners are assumed to be folded and enabled.

  • random (bool) – When True, the positioners are placed randomly on the focal plane (always with the beta arm in a safe configuration). Positioners with data provided in positioner_data are still placed at the provided position.

fold()[source]

Folds all the positioners.

randomise()[source]

Randomises all the positioners.

rearrange(new_positions)[source]

Reset the positioner to a new configuration.

Parameters:

new_positions (Mapping[int, Mapping[str, float | bool]])

async update_position(*args, **kwargs)[source]

Override update_position to do nothing.

Return type:

ndarray | bool

class jaeger.testing.VirtualFPS(*args, **kwargs)[source]

Bases: FPS

A mock Focal Plane System for testing and development.

This class listens to a virtual bus and responds as if real positioners were plugged into the system.

_check_fibre_assignments(*args, **kwargs)[source]

Checks that all the expected robots are present.

class jaeger.testing.VirtualPositioner(positioner_id, bus=None, centre=None, position=(0.0, 0.0), speed=None, firmware='10.11.12')[source]

Bases: StatusMixIn

A virtual positioner that listen to CAN commands.

An object of VirtualPositioner represents a real positioner firmware. It knows it’s own state at any time and replies.

Parameters:
  • positioner_id (int) – The ID of the positioner.

  • centre (tuple | None) – A tuple of two floats indicating where on the focal plane the positioner is located.

  • position (Tuple[float, float]) – A tuple of two floats indicating the angles of the alpha and beta arms.

  • speed (tuple | None) – A tuple of two float indicating the RPM on the input for alpha and beta.

  • firmware (str) – The firmware version, as a string with the format AB.CD.EF.

  • bus (VirtualBus | None)

is_bootloader()[source]

Returns True if the positioner is in bootloader mode.

async process_firmware_data(uid, data)[source]

Processes SEND_FIRMWARE_DATA commands.

async process_goto(message)[source]

Process an absolute or relative goto command.

async process_message(msg, positioner_id, command_id, uid)[source]

Processes incoming commands from the bus.

reset()[source]

Resets the positioner.

set_bootloader(bootloader=True)[source]

Sets the positioner in bootloader mode.

_initial_status = 17384367873

The initial status of the positioner. Represents a positioner that is not moving and is fully calibrated.