ska_oso_scripting.functions.pdm_transforms

The pdm_transforms module contains code to transform Project Data Model (PDM) entities to Configuration Data Model (CDM) entities. The pdm_transforms code is called by observing scripts to convert the PDM Scheduling Block to the equivalent CDM configurations, which are then sent to TMC devices to control the telescope.

ska_oso_scripting.functions.pdm_transforms.csp.convert_cspconfiguration(pdm_config: ska_oso_pdm.sb_definition.csp.CSPConfiguration, receiver_band: ska_oso_pdm.sb_definition.dish.dish_configuration.ReceiverBand | ska_tmc_cdm.messages.subarray_node.configure.csp.core.ReceiverBand | None = None) ska_tmc_cdm.messages.subarray_node.configure.csp.CSPConfiguration[source]

Convert a PDM CSPConfiguration to the equivalent CDM CSPConfiguration.

Parameters:
  • pdm_config – The PDM configuration to convert

  • receiver_band – PDM receiver band to set for this configuration

Returns:

the equivalent CDM configuration

The pdm_transforms module contains code to transform Project Data Model (PDM) entities to Configuration Data Model (CDM) entities. The pdm_transforms code is called by observing scripts to convert the PDM Scheduling Block to the equivalent CDM configurations, which are then sent to TMC devices to control the telescope.

ska_oso_scripting.functions.pdm_transforms.mccs.convert_mccsallocation(mccsallocation: ska_oso_pdm.sb_definition.MCCSAllocation, subarray_beam_map: Mapping[ska_oso_pdm.sb_definition.mccs.mccs_allocation.SubarrayBeamID, int], union: bool = False) List[ska_tmc_cdm.messages.central_node.mccs.MCCSAllocate][source]

Convert a PDM Low MCCSAllocation to a list of CDM MCCSAllocate instances, one CDM instance per beam.

At the time of writing (PI10), MCCS requires subarray beams to be allocated one at a time, that is, one subarray beam per allocation request. This behaviour can be toggled by setting the union argument. When union is set to True, this function returns a list of CDM instances, each instance narrowed to configure a single beam.

Parameters:
  • mccsallocation – The PDM MCCSAllocation

  • subarray_beam_map – mapping of offline beam IDs to online beam IDs

  • union – True to create one multi-beam request, False to create n per-beam requests

Returns:

equivalent CDM instances

ska_oso_scripting.functions.pdm_transforms.mccs.convert_mccs_configuration(mccs_allocation: ska_oso_pdm.sb_definition.MCCSAllocation, target_beam_configurations: List[ska_oso_pdm.sb_definition.TargetBeamConfiguration], targets: List[ska_oso_pdm.sb_definition.Target], subarray_beam_configurations: List[ska_oso_pdm.sb_definition.SubarrayBeamConfiguration], subarray_beam_map: Mapping[ska_oso_pdm.sb_definition.mccs.mccs_allocation.SubarrayBeamID, int]) ska_tmc_cdm.messages.subarray_node.configure.mccs.MCCSConfiguration[source]

Convert PDM Low SB TargetBeamConfiguration list to a CDM MCCSConfiguration.

Other SB elements required are the Target list and SubarrayBeamConfiguration list, which are referenced by the TargetBeamConfigurations.

The MCCSAllocation is also needed for its list of station_ids.

Parameters:
  • mccs_allocation – The PDM MCCSAllocation

  • target_beam_configurations – The PDM TargetBeamConfiguration list

  • targets – The PDM Target list

  • subarray_beam_configurations – The PDM SubarrayBeamConfiguration list

  • subarray_beam_map – mapping of offline beam IDs to online beam IDs

Returns:

the required CDM MCCSConfiguration

The pdm_transforms module contains code to transform Project Data Model (PDM) entities to Configuration Data Model (CDM) entities. The pdm_transforms code is called by observing scripts to convert the PDM Scheduling Block to the equivalent CDM configurations, which are then sent to TMC devices to control the telescope.

ska_oso_scripting.functions.pdm_transforms.dish.convert_pointingconfiguration(target: ska_oso_pdm.sb_definition.Target, correction: ska_oso_pdm.sb_definition.PointingCorrection) ska_tmc_cdm.messages.subarray_node.configure.PointingConfiguration[source]

Convert a PDM Target to the equivalent TMC configuration

ska_oso_scripting.functions.pdm_transforms.dish.convert_dishconfiguration(dish_configuration: ska_oso_pdm.sb_definition.DishConfiguration) ska_tmc_cdm.messages.subarray_node.configure.DishConfiguration[source]

Convert a PDM Dish configuration to a CDM Dish Configuration

ska_oso_scripting.functions.pdm_transforms.dish.convert_dishallocation(dish_allocation: ska_oso_pdm.sb_definition.DishAllocation) ska_tmc_cdm.messages.central_node.common.DishAllocation[source]

Convert a PDM DishAllocation to the equivalent CDM DishAllocation.

The pdm_transforms module contains code to transform Project Data Model (PDM) entities to Configuration Data Model (CDM) entities. The pdm_transforms code is called by observing scripts to convert the PDM Scheduling Block to the equivalent CDM configurations, which are then sent to TMC devices to control the telescope.

ska_oso_scripting.functions.pdm_transforms.common.convert_tmcconfiguration(scan_definition: ska_oso_pdm.sb_definition.ScanDefinition) ska_tmc_cdm.messages.subarray_node.configure.tmc.TMCConfiguration[source]

Convert a PDM ScanDefinition to the equivalent TMC configuration

The pdm_transforms.sdp module contains code to transform SDP Project Data Model (PDM) entities to Configuration Data Model (CDM) entities.

ska_oso_scripting.functions.pdm_transforms.sdp.convert_sdpconfiguration_centralnode(pdm_config: ska_oso_pdm.sb_definition.sdp.SDPConfiguration, pdm_targets: List[ska_oso_pdm.sb_definition.Target]) ska_tmc_cdm.messages.central_node.sdp.SDPConfiguration[source]

Convert a PDM SDPConfiguration to the equivalent CDM SDPConfiguration.

In a SchedulingBlockDefinition, Targets are recorded exactly once as PDM Targets separate and external to any SDPConfiguration. Targets to be inserted into the output SDPConfiguration should be passed to this function.

Parameters:
  • pdm_config – the SDPConfiguration to convert

  • pdm_targets – Targets to inject into output SDP configuration

Raises:

TypeError – if pdm_config is not an SDPConfiguration

ska_oso_scripting.functions.pdm_transforms.sdp.convert_sdpconfiguration_subarraynode(scan_definition: ska_oso_pdm.sb_definition.ScanDefinition) ska_tmc_cdm.messages.subarray_node.configure.sdp.SDPConfiguration[source]

Convert a PDM Scan Definition to an SDP Configuration aspect of a TMC SubArrayNode.Configure call

The pdm_transforms module contains code to transform Project Data Model (PDM) entities to Configuration Data Model (CDM) entities. The pdm_transforms code is called by observing scripts to convert the PDM Scheduling Block to the equivalent CDM configurations, which are then sent to TMC devices to control the telescope.

ska_oso_scripting.functions.pdm_transforms.wrapper.create_cdm_configure_request_from_scheduling_block(scheduling_block: ska_oso_pdm.sb_definition.SBDefinition) Dict[source]

creates a dictionary mapping PDM scan definition ids to a list of CDM ConfigureRequest objects

ska_oso_scripting.functions.pdm_transforms.wrapper.create_cdm_assign_resources_request_from_scheduling_block(subarray_id: int, scheduling_block: ska_oso_pdm.sb_definition.SBDefinition) List[ska_tmc_cdm.messages.central_node.assign_resources.AssignResourcesRequest][source]

creates a list of CDM AssignResourcesRequest object from a Scheduling Block