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(telescope: ska_oso_pdm.TelescopeType, pdm_config: ska_oso_pdm.sb_definition.csp.CSPConfiguration, pdm_mccs_allocation: ska_oso_pdm.sb_definition.MCCSAllocation | None = None, target: ska_oso_pdm.sb_definition.Target | None = None, 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]

Converts the relevant parts of the SBDefinition into a CDM CSPConfiguration.

Parameters:
  • telescope – telescope type, either SKA_MID or SKA_LOW

  • pdm_config – The PDM CSPConfiguration to convert

  • pdm_mccs_allocation – The PDM MCCSAllocation that is also required for the conversion

  • target – The PDM target that is used for tied array observations (support for LOW only)

  • 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_mccs_allocation(allocation: ska_oso_pdm.sb_definition.MCCSAllocation) ska_tmc_cdm.messages.central_node.mccs.MCCSAllocate[source]

Convert a PDM Low MCCSAllocation to a CDM MCCSAllocate instance.

ska_oso_scripting.functions.pdm_transforms.mccs.convert_mccs_configuration(allocation: ska_oso_pdm.sb_definition.MCCSAllocation, lowcbf: ska_oso_pdm.sb_definition.csp.LowCBFConfiguration | None, target: ska_oso_pdm.sb_definition.Target) 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

  • lowcbf – The low cfg configuration

  • targets – The PDM Target list

Returns:

the required CDM MCCSConfiguration

ska_oso_scripting.functions.pdm_transforms.mccs.get_subarray_beam_ids(allocation: ska_oso_pdm.sb_definition.MCCSAllocation) list[int][source]

Get the subarray beam ids array from the MCC Allocation

ska_oso_scripting.functions.pdm_transforms.mccs.get_station_ids(allocation: ska_oso_pdm.sb_definition.MCCSAllocation) list[list[int]][source]

Get the station ids from the MCC Allocation

ska_oso_scripting.functions.pdm_transforms.mccs.get_allocation_apertures(subarray_beam: ska_tmc_cdm.messages.central_node.mccs.SubArrayBeamsConfiguration) list[ska_tmc_cdm.messages.central_node.mccs.ApertureConfiguration][source]

Get the apertures from one of the subArray beam of MCC Allocation

ska_oso_scripting.functions.pdm_transforms.mccs.get_sky_coordinates_based_on_reference_coordinates(target: ska_oso_pdm.sb_definition.Target) ska_tmc_cdm.messages.subarray_node.configure.mccs.SubarrayBeamSkyCoordinates[source]

Get the sky coordinates based on target reference_coordinates target is an instance of HorizontalCoordinates”, set reference_frame to “topocentric” and pass c1=az, c2=el target is an instance of EquatorialCoordinates”, set reference_frame to “ICRS” and pass c1=ra, c2=dec

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

ska_oso_scripting.functions.pdm_transforms.sdp.create_sdpconfiguration_centralnode(pdm_config: ska_oso_pdm.sb_definition.SBDefinition) ska_tmc_cdm.messages.central_node.sdp.SDPConfiguration[source]

Create a SDPConfiguration.

Parameters:

pdm_config – the SBDefinition to use in creation

Raises:

TypeError – if pdm_config is not an SDPConfiguration

ska_oso_scripting.functions.pdm_transforms.sdp.create_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 if no PDM SDPConfiguration is present

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[str, list[ska_tmc_cdm.messages.subarray_node.configure.ConfigureRequest]][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) ska_tmc_cdm.messages.central_node.assign_resources.AssignResourcesRequest[source]

creates a list of CDM AssignResourcesRequest object from a Scheduling Block