ska_oso_scripting.objects
The ska_oso_objects module holds the object-oriented scripting interface for SKA telescope and subarray control.
- class ska_oso_scripting.objects.SubArray(identifier: int | str)[source]
SubArray represents an SKA telescope subarray.
SubArrays are identified by a numeric ID, which is an integer between 1 and 16. This ID, accessible as SubArray.id, corresponds to the TMC SubArrayNode of the same ID that is controlled by invoking methods on a SubArray instance. SubArray objects with the same numeric ID are considered equal.
- SubArrays are used to:
allocate resources to a subarray
configure a subarray
instruct a subarray to commence scanning
end an SB
release subarray resources
- assign_from_file(path: str, with_processing: bool = True, timeout: float | None = None) None [source]
Allocate resources to a subarray using a JSON file.
This method reads in a file, verifies that the file contents are a valid CDM resource allocation string, before using that JSON as the basis of a resource allocation control sequence. This method returns once the targeted subarray indicates that resources have been allocated or an error occurs.
Note that some JSON content will be replaced (Execution Block IDs, etc.) as required by the telescope control model, so what is sent to the telescope control system may not exactly match the contents of the file. To disable this JSON processing and send the raw contents of the file to the system, set with_processing to False. Note that you will be responsible for ensuring JSON correctness, Execution Block ID uniqueness, etc.
- Parameters:
path – path to the CDM JSON file
with_processing – perform JSON validation and processing (default=True)
timeout – custom timeout provided while execution of assign resource command if systems do not respond within reasonable timescales then method raised EventTimeoutError.
- assign_from_cdm(request: ska_tmc_cdm.messages.central_node.assign_resources.AssignResourcesRequest, timeout: float | None = None) None [source]
Allocate resources to this subarray using a CDM AssignResourcesRequest object.
Given a well-formed CDM AssignResourcesRequest object, this method will perform a resource allocation control sequence, returning once the targeted subarray indicates that resources have been allocated.
- Parameters:
request – CDM resource allocation request
timeout – custom timeout provided while execution of assign resource command if systems do not respond within reasonable timescales then method raised EventTimeoutError.
- release(request: ska_tmc_cdm.messages.central_node.release_resources.ReleaseResourcesRequest | None = None, timeout: float | None = None) None [source]
Release subarray resources.
This method blocks until the subarray has released resources or an error occurs.
By default, all subarray resources will be released. To release some but not all of the subarray resources (partial release), give this method a CDM ReleaseResourcesRequest instance defining which resources should be deallocated.
- Parameters:
request – optional CDM request object for partial deallocation
timeout – custom timeout provided while execution of release resource command’s if systems do not respond within reasonable timescales then method raised EventTimeoutError.
- configure_from_cdm(request: ska_tmc_cdm.messages.subarray_node.configure.ConfigureRequest, timeout: float | None = None) None [source]
Configure subarray resources using a CDM ConfigureRequest object.
This method blocks when the subarray has completed resource configuration or when an error occurs.
- Parameters:
request – CDM configure request instance
timeout – custom timeout provided while execution of configure command if systems do not respond within reasonable timescales then method raised EventTimeoutError.
- configure_from_file(cdm_file: str, with_processing=True, timeout: float | None = None) None [source]
Configure subarray resources using a JSON file.
This method reads in a file, verifies that the file contents are a valid CDM configuration JSON, before using that JSON as the basis of a subarray configuration control sequence. This method returns once the targeted subarray indicates that resources have been configured or an error occurs.
This method validates and processes the JSON before sending it downstream. To bypass JSON processing and validation, set the with_processing argument to False.
- Parameters:
cdm_file – path of the exported CDM
with_processing – perform JSON validation and processing (default=True)
timeout – custom timeout provided while execution of configure command if systems do not respond within reasonable timescales then method raised EventTimeoutError.
- scan(timeout: float | None = None) None [source]
Start a scan.
This method returns once the scan is complete or an error occurs.
The subarray should have resources allocated and configured before this command is called.
- Parameters:
timeout – custom timeout provided while execution of scan command if systems do not respond within reasonable timescales then method raised EventTimeoutError.
- end() None [source]
End Scheduling Block, marking the end of the active observing sequence.
This method returns once the underlying subarray becomes idle or if an error occurs.
- class ska_oso_scripting.objects.Telescope[source]
Telescope represents an SKA telescope.
Telescope methods will control the SKA telescope appropriate to the environment. That is, calling Telescope.on() inside an SKA MID environment will control the SKA MID devices, while calling the method inside an SKA LOW environment will control SKA LOW devices.