Dish Master

override class with command handlers for dsh-lmc.

class tmcprototype.dishmaster.src.dishmaster.dish_master_behaviour.AzEl(azim, elev)
azim

Alias for field number 0

elev

Alias for field number 1

class tmcprototype.dishmaster.src.dishmaster.dish_master_behaviour.OverrideDish
AZIM_DRIVE_MAX_RATE = 3.0
AZIM_IDX = 1
ELEV_DRIVE_MAX_RATE = 1.0
ELEV_IDX = 2
FAILED = 2
MAINT_AZIM = 90.0
MAX_DESIRED_AZIM = 270.0
MAX_DESIRED_ELEV = 90.0
MAX_SAMPLE_HISTORY = 2400
MIN_DESIRED_AZIM = -270.0
MIN_DESIRED_ELEV = 15.0
OK = 0
TS_IDX = 0
action_configureband1(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the CONFIGURE Dish Element Mode, and returns to the caller. To configure the Dish to operate in frequency band 1. On completion of the band configuration, Dish will automatically revert to the previous Dish mode (OPERATE or STANDBY-FP).

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP, OPERATE, STOW).

action_configureband2(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the CONFIGURE Dish Element Mode, and returns to the caller. To configure the Dish to operate in frequency band 2. On completion of the band configuration, Dish will automatically revert to the previous Dish mode (OPERATE or STANDBY-FP).

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP, OPERATE, STOW).

action_configureband3(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the CONFIGURE Dish Element Mode, and returns to the caller. To configure the Dish to operate in frequency band 3. On completion of the band configuration, Dish will automatically revert to the previous Dish mode (OPERATE or STANDBY-FP).

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP, OPERATE, STOW).

action_configureband4(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the CONFIGURE Dish Element Mode, and returns to the caller. To configure the Dish to operate in frequency band 4. On completion of the band configuration, Dish will automatically revert to the previous Dish mode (OPERATE or STANDBY-FP).

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP, OPERATE, STOW).

action_configureband5a(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the CONFIGURE Dish Element Mode, and returns to the caller. To configure the Dish to operate in frequency band 5a. On completion of the band configuration, Dish will automatically revert to the previous Dish mode (OPERATE or STANDBY-FP).

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP, OPERATE, STOW).

action_configureband5b(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the CONFIGURE Dish Element Mode, and returns to the caller. To configure the Dish to operate in frequency band 5b. On completion of the band configuration, Dish will automatically revert to the previous Dish mode (OPERATE or STANDBY-FP).

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP, OPERATE, STOW).

action_configureband5c(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the CONFIGURE Dish Element Mode, and returns to the caller. To configure the Dish to operate in frequency band 5c. On completion of the band configuration, Dish will automatically revert to the previous Dish mode (OPERATE or STANDBY-FP).

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP, OPERATE, STOW).

action_lowpower(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the LOW power state. All subsystems go into a low power state to power only the essential equipment. Specifically the Helium compressor will be set to a low power consumption, and the drives will be disabled. When issued a STOW command while in LOW power, the DS controller should be able to turn the drives on, stow the dish and turn the drives off again. The purpose of this mode is to enable the observatory to perform power management (load curtailment), and also to conserve energy for non-operating dishes.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STOW, MAINTENANCE).

action_resettracktable(model, tango_dev=None, data_input=None)

Resets the coordinates in the queue. Clear ACU’s table (should show number of coordinates drops to zero)

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
action_resettracktablebuffer(model, tango_dev=None, data_input=None)

Resets the Dish LMC’s buffer. (In our case it’s desired_pointings)

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
action_scan(model, tango_dev=None, data_input=None)

The Dish is tracking the commanded pointing positions within the specified SCAN pointing accuracy.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (OPERATE).

action_setmaintenancemode(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the MAINTENANCE Dish Element Mode, and returns to the caller. To go into a state that is safe to approach the Dish by a maintainer, and to enable the Engineering interface to allow direct access to low level control and monitoring by engineers and maintainers. This mode will also enable engineers and maintainers to upgrade SW and FW. Dish also enters this mode when an emergency stop button is pressed.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-LP, STANDBY-FP).

action_setoperatemode(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the OPERATE Dish Element Mode, and returns to the caller. This mode fulfils the main purpose of the Dish, which is to point to designated directions while capturing data and transmitting it to CSP.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-FP).

action_setstandbyfpmode(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the STANDBY-FP Dish Element Mode, and returns to the caller. To prepare all subsystems for active observation, once a command is received by TM to go to the FULL_POWER mode.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (STANDBY-LP, STOW, OPERATE, MAINTENANCE).

action_setstandbylpmode(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the STANDBY-LP Dish Element Mode, and returns to the caller. Standby_LP is the default mode when the Dish is configured for low power consumption, and is the mode wherein Dish ends after a start up procedure.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (OFF, STARTUP, SHUTDOWN, STANDBY-FP, MAINTENANCE, STOW, CONFIG, OPERATE).

action_setstowmode(model, tango_dev=None, data_input=None)

This command triggers the Dish to transition to the STOW Dish Element Mode, and returns to the caller. To point the dish in a direction that minimises the wind loads on the structure, for survival in strong wind conditions. The Dish is able to observe in the stow position, for the purpose of transient detection.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (OFF, STARTUP, SHUTDOWN, STANDBY-LP, STANDBY-FP, MAINTENANCE, CONFIG, OPERATE).

action_slew(model, tango_dev=None, data_input=None)

The Dish moves to the commanded pointing angle at the maximum speed, as defined by the specified slew rate.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – list [0]: Azimuth [1]: Elevation
Raises:

DevFailed – dishMode is not in any of the allowed modes (OPERATE).

action_startcapture(model, tango_dev=None, data_input=None)

Triggers the dish to start capturing the data on the configured band.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (OPERATE) or configuredBand is (NONE, UNKNOWN, ERROR, UNDEFINED).

action_stopcapture(model, tango_dev=None, data_input=None)

Triggers the dish to stop capturing the data on the configured band.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
action_track(model, tango_dev=None, data_input=None)

The Dish is tracking the commanded pointing positions within the specified TRACK pointing accuracy.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (OPERATE).

action_trackstop(model, tango_dev=None, data_input=None)

The Dish will stop tracking but will not apply brakes. Stops movement, but doesn’t clear tables/queues.

Parameters:
  • model – tango_simlib.model.Model
  • data_input – None
Raises:

DevFailed – dishMode is not in any of the allowed modes (OPERATE).

actual_position = AzEl(azim=0.0, elev=30.0)
desired_pointings = []
ensure_within_mechanical_limits(next_pos)
find_next_position(desired_pointings, sim_time)

Return the latest desiredPointing not in the future, or last requested.

get_new_unverified_pointings(model)

Return the latest list of coordinates

Parameters:model – Model The device Model
Returns:list - Empty if no updates have occured since the last time - 1 entry of desiredPointing if it is the latest - All the entries of programTrackTable if it is the latest (7 in testing)
get_new_valid_pointings(model)
get_rate_limited_position(current_pos, next_pos, dt)
static is_movement_allowed(model)
is_on_target()
last_coordinate_update_timestamp = 0.0
move_towards_target(sim_time, dt)
pre_update(model, sim_time, dt)
requested_position = AzEl(azim=0.0, elev=30.0)
set_achieved_pointing_attribute(model, sim_time, position)
static set_lock_attribute(model, target_reached)
update_desired_pointing_history(model)
update_movement_attributes(model, sim_time)
tmcprototype.dishmaster.src.dishmaster.dish_master_behaviour.get_direction_sign(here, there)

Return sign (+1 or -1) required to move from here to there.

tmcprototype.dishmaster.src.dishmaster.dish_master_behaviour.get_enum_str(quantity)

Returns the enum label of an enumerated data type

Parameters:quantity – object The quantity object of a DevEnum attribute
Returns:str Current string value of a DevEnum attribute
tmcprototype.dishmaster.src.dishmaster.dish_master_behaviour.set_enum(quantity, label, timestamp)

Sets the quantity last_val attribute to index of label

Parameters:
  • quantity – object The quantity object from model
  • label – str The desired label from enum list
  • timestamp – float The time now