MockServer#

class lsst.ts.cbp.MockServer(log=None)#

Bases: OneClientReadLoopServer

Mocks the CBP server.

Parameters:

log (logging.Logger, optional) – Optional logger used for mock-server diagnostics.

host#
Type:

str

port#
Type:

int

timeout#
Type:

int

long_timeout#
Type:

int

azimuth#
Type:

float

altitude#
Type:

float

focus#
Type:

int

mask#
Type:

str

panic_status#
Type:

bool

encoders#
Type:

Encoders

park#
Type:

bool

auto_park#
Type:

bool

movement_reply#

Reply string returned by motion commands.

Type:

str

commands#

Command dispatch table.

Type:

tuple of re.Pattern to Callable

log#
Type:

logging.Logger

Methods Summary

cmd_loop()

Run the command loop.

do_aastat()

Return the azimuth encoder status.

do_abstat()

Return the altitude encoder status.

do_acstat()

Return the focus encoder status.

do_adstat()

Return the mask selection encoder status.

do_aestat()

Return the mask rotation encoder status.

do_altitude()

Return the altitude position.

do_autopark()

Return the autopark value.

do_azimuth()

Return azimuth position.

do_focus()

Return the focus value.

do_mask()

Return the mask value.

do_new_altitude(altitude)

Set the new altitude position.

do_new_azimuth(azimuth)

Set the new azimuth position.

do_new_focus(focus)

Set the new focus value.

do_new_mask(mask)

Set the new mask value.

do_new_rotation(rotation)

Set the new mask rotation value.

do_panic()

Return the panic status value.

do_park([park])

Park or unpark the CBP.

do_rotation()

Return the mask rotation value.

read_and_dispatch()

Read one command and dispatch it to the matching handler.

set_circular_constrained_position(value, ...)

Set actuator to position that is silently constrained to bounds.

set_constrained_position(value, actuator)

Set actuator to position that is silently constrained to bounds.

Methods Documentation

async cmd_loop()#

Run the command loop.

Return type:

None

async do_aastat()#

Return the azimuth encoder status.

Returns:

status – Current azimuth encoder status returned by the mock controller.

Return type:

str

async do_abstat()#

Return the altitude encoder status.

Returns:

status – Current altitude encoder status returned by the mock controller.

Return type:

str

async do_acstat()#

Return the focus encoder status.

Returns:

status – Current focus encoder status returned by the mock controller.

Return type:

str

async do_adstat()#

Return the mask selection encoder status.

Returns:

status – Current mask selection encoder status returned by the mock controller.

Return type:

str

async do_aestat()#

Return the mask rotation encoder status.

Returns:

status – Current mask rotation encoder status returned by the mock controller.

Return type:

str

async do_altitude()#

Return the altitude position.

Returns:

position – Current altitude position returned by the mock controller.

Return type:

str

async do_autopark()#

Return the autopark value.

Returns:

state – Current autopark state returned by the mock controller.

Return type:

str

async do_azimuth()#

Return azimuth position.

Returns:

position – Current azimuth position returned by the mock controller.

Return type:

str

async do_focus()#

Return the focus value.

Returns:

position – Current focus position returned by the mock controller.

Return type:

str

async do_mask()#

Return the mask value.

Returns:

mask – Current mask identifier returned by the mock controller.

Return type:

str

async do_new_altitude(altitude)#

Set the new altitude position.

Parameters:

altitude (str) – Desired altitude position in degrees.

Returns:

reply – Movement reply returned by the mock controller.

Return type:

str

async do_new_azimuth(azimuth)#

Set the new azimuth position.

Parameters:

azimuth (str) – Desired azimuth position in degrees.

Returns:

reply – Movement reply returned by the mock controller.

Return type:

str

async do_new_focus(focus)#

Set the new focus value.

Parameters:

focus (str) – Desired focus position in microns.

Returns:

reply – Movement reply returned by the mock controller.

Return type:

str

async do_new_mask(mask)#

Set the new mask value.

Parameters:

mask (str) – Desired mask identifier.

Returns:

reply – Movement reply returned by the mock controller.

Return type:

str

async do_new_rotation(rotation)#

Set the new mask rotation value.

Parameters:

rotation (str) – Desired mask rotation in degrees.

Returns:

reply – Movement reply returned by the mock controller.

Return type:

str

async do_panic()#

Return the panic status value.

Returns:

status – Current panic status returned by the mock controller.

Return type:

str

async do_park(park='?')#

Park or unpark the CBP.

Parameters:

park (str, optional) – "?" queries the current park state, otherwise "0" or "1" sets it.

Returns:

state – Current or newly set park state returned by the mock controller.

Return type:

str

async do_rotation()#

Return the mask rotation value.

Returns:

rotation – Current mask rotation returned by the mock controller.

Return type:

str

async read_and_dispatch()#

Read one command and dispatch it to the matching handler.

Return type:

None

set_circular_constrained_position(value, actuator)#

Set actuator to position that is silently constrained to bounds.

Parameters:
Return type:

None

set_constrained_position(value, actuator)#

Set actuator to position that is silently constrained to bounds.

Parameters:
Return type:

None