Skip to content

Implemented the changes to subarray commands and states for ADR-8

Nijin Thykkathu requested to merge SIM-481_implement_subarray_command_state into master

Implemented the changes to subarray commands and states for ADR-8 Updated the test functions to match the changes.

Testing

Start a tango facility by running::

kubectl exec -it itango-tango-base-sdp-prototype -- /venv/bin/itango3

You obtain a handle for the first subarray device with::

d = DeviceProxy('mid_sdp/elt/subarray_1')

or for the second device with::

d = DeviceProxy('mid_sdp/elt/subarray_2')

Then query the status of the device with::

d.status()

When first initialised the device will report 'The device is in OFF state.'

To query the obsState attribute::

d.obsState

This will return <obsState.EMPTY: 0>

First, need to set the subarray device into its Operational state and that can be done by the On command::

d.On()

The subarray device should now be ON, but the obsState remains EMPTY.

Create a configuration string for the scheduling block instance::

config_sbi = ''' { "id": "sbi-mvp01-20200425-00000", "max_length": 21600.0, "scan_types": [ { "id": "science_A", "coordinate_system": "ICRS", "ra": "02:42:40.771", "dec": "-00:00:47.84", "channels": [{ "count": 744, "start": 0, "stride": 2, "freq_min": 0.35e9, "freq_max": 0.368e9, "link_map": [[0,0], [200,1], [744,2], [944,3]] },{ "count": 744, "start": 2000, "stride": 1, "freq_min": 0.36e9, "freq_max": 0.368e9, "link_map": [[2000,4], [2200,5]] }] }, { "id": "calibration_B", "coordinate_system": "ICRS", "ra": "12:29:06.699", "dec": "02:03:08.598", "channels": [{ "count": 744, "start": 0, "stride": 2, "freq_min": 0.35e9, "freq_max": 0.368e9, "link_map": [[0,0], [200,1], [744,2], [944,3]] },{ "count": 744, "start": 2000, "stride": 1, "freq_min": 0.36e9, "freq_max": 0.368e9, "link_map": [[2000,4], [2200,5]] }] } ], "processing_blocks": [ { "id": "pb-mvp01-20200425-00000", "workflow": {"type": "realtime", "id": "test_realtime", "version": "0.1.0"}, "parameters": {} }, { "id": "pb-mvp01-20200425-00001", "workflow": {"type": "realtime", "id": "test_receive_addresses", "version": "0.3.2"}, "parameters": {} }, { "id": "pb-mvp01-20200425-00002", "workflow": {"type": "batch", "id": "ical", "version": "0.1.0"}, "parameters": {}, "dependencies": [ {"pb_id": "pb-mvp01-20200425-00000", "type": ["visibilities"]} ] }, { "id": "pb-mvp01-20200425-00003", "workflow": {"type": "batch", "id": "dpreb", "version": "0.1.0"}, "parameters": {}, "dependencies": [ {"pb_id": "pb-mvp01-20200425-00002", "type": ["calibration"]} ] } ] } '''

The scheduling block instance is started by the AssignResources command::

d.AssignResources(config_sbi)

which changes the obsState to RESOURCING and then to IDLE. At this point, receive addresses will be set.

Before executing a scan, we need to configure the scan type. This is done by passing the scan type to the Configure command::

d.Configure('{"scan_type": "science"}')

which changes the obsState to CONFIGURING and then to READY.

To start a scan, we need to pass the scan ID to the Scan command::

d.Scan('{"id": 1}')

which changes the obsState to SCANNING.

The scan is ended with the EndScan command::

d.EndScan()

which changes the obsState to READY again.

The End command clears the scan type::

d.End()

which changes the obsState to IDLE.

Finally, when the obsState is IDLE, the scheduling block instance is ended by the ReleaseResources command::

d.ReleaseResources()

after which the obsState should be EMPTY.

To set the subarray device into its Inactive state which can be done by the Off command::

d.Off()

To abort current activity can be done by the Abort command::

d.Abort()

To reset the obsState to the last known stable state can be done by the ObsReset command::

d.ObsReset()

To restart the subarray device can be done by the Restart command::

d.Restart()
Edited by Nijin Thykkathu

Merge request reports