API

ska_tmc_cdm.jsonschema

ska_tmc_cdm.jsonschema.json_schema

The JSON Schema module contains methods for fetching version-specific JSON schemas using interface uri and validating the structure of JSON against these schemas.

class JsonSchema[source]

JSON Schema use for validating the structure of JSON data

static get_schema_by_uri(uri: str) Schema[source]

Retrieve JSON Schemas from remote server.

Parameters:

uri – Interface Version URI

Returns:

Interface schema

Raises:

SchemaNotFound if URI does not resolve to a schema

static semantic_validate_schema(instance: dict, uri: str) None[source]

Validate an instance dictionary under the given schema.

Parameters:
  • uri – The schema to validate with

  • instance – The instance to validate

Returns:

None, in case of valid data otherwise, it raises an exception.

static validate_schema(uri: str, instance: dict, strictness=None) None[source]

Validate an instance dictionary under the given schema.

strictness can be set from 0-2. Values equal:

0: permissive warnings 1: permissive errors and strict warnings 2: strict errors

Parameters:
  • uri – The schema to validate with

  • instance – The instance to validate

  • strictness – strictness level

Returns:

None, in case of valid data otherwise, it raises an exception.

ska_tmc_cdm.messages

The ska_tmc_cdm.messages package contains modules that maps Tango structured arguments to Python.

ska_tmc_cdm.messages.central_node

The ska_tmc_cdm.messages.central_node package holds modules that translate TMC Central Node requests and responses to and from Python.

ska_tmc_cdm.messages.central_node.assign_resources

The messages module provides simple Python representations of the structured request and response for the TMC CentralNode.AssignResources command.

class AssignResourcesRequest

AssignResourcesRequest is a Python representation of the structured argument for a TMC CentralNode.AssignResourcesRequest request.

Parameters:
Raises:

ValueError – if mccs is allocated with dish and sdp_config

from_dish()
from_mccs()
class AssignResourcesResponse

AssignResourcesResponse is a Python representation of the structured response from a TMC CentralNode.AssignResources request.

ska_tmc_cdm.messages.central_node.release_resources

The release_resources module provides simple Python representations of the structured request and response for a TMC CentralNode.ReleaseResources call.

class ReleaseResourcesRequest

ReleaseResourcesRequest is a Python representation of the structured request for a TMC CentralNode.ReleaseResources call.

Parameters:
  • interface – url string to determine JsonSchema version, defaults to https://schema.skao.int/ska-tmc-releaseresources/2.1 if not set

  • transaction_id – ID for tracking requests

  • subarray_id – the numeric SubArray ID (1..16)

  • release_all – True to release all sub-array resources, False to

release just those resources specified as other arguments :param dish_allocation: object holding the DISH resource allocation to release for this request.

ska_tmc_cdm.messages.central_node.common

The messages module provides simple Python representations of the structured request and response for the TMC CentralNode.AssignResources command.

class DishAllocation

DishAllocation represents the DISH allocation part of an AssignResources request and response.

Parameters:

receptor_ids – (optional) IDs of the receptors to add to this

allocation

ska_tmc_cdm.messages.central_node.sdp

The messages module provides simple Python representations of the structured request and response for the TMC CentralNode.AssignResources command.

class BeamConfiguration

Class to hold Dependencies for Beam Configuration

Parameters:
  • beam_id – Name to identify the beam within the SDP configuration.

  • function – Identifies the type and origin of the generated beam data.

  • search_beam_id – search_beam_id

  • timing_beam_id – timing_beam_id

  • vlbi_beam_id – vlbi_beam_id

class Channel

Class to hold Channels for ScanType

Create a new Channel object.

Parameters:
  • count – Number of channels

  • start – First channel ID

  • stride – Distance between subsequent channel IDs

  • freq_min – Lower bound of first channel

  • freq_max – Upper bound of last channel

  • link_map – Channel map that specifies which network link is going to get used to send channels to SDP. Intended to allow SDP to optimize network and receive node configuration.

  • spectral_window_id – spectral_window_id

class ChannelConfiguration

Class to hold Dependencies for Channel Configuration

Parameters:
  • channels_id – channels_id

  • spectral_windows – spectral_windows

class EBScanType

Class to hold EBScanType configuration

Parameters:
  • scan_type_id – scan_type_id

  • beams – Beam parameters for the purpose of the Science Data Processor.

  • derive_from – derive_from

class EBScanTypeBeam

Class to hold EBScanTypeBeam Configuration

Parameters:
  • field_id – field_id

  • channels_id – channels_id

  • polarisations_id – polarisations_id

class ExecutionBlockConfiguration

Class to hold ExecutionBlock configuration

Parameters:
  • eb_id – Execution block ID to associate with processing

  • max_length – Hint about the maximum observation length to support by the SDP.

  • context – Free-form information from OET, see ADR-54

  • beams – Beam parameters for the purpose of the Science Data Processor.

  • channels – Spectral windows per channel configuration.

  • polarisations – Polarisation definition.

  • fields – Fields / Targets

  • scan_types – Scan types. Associates scans with per-beam fields & channel configurations

class FieldConfiguration

Class to hold Field configuration

Parameters:
  • field_id – field_id

  • pointing_fqdn – pointing_fqdn

  • phase_dir – Phase direction

class PbDependency

Class to hold Dependencies for ProcessingBlock

Parameters:
  • pb_id – Unique identifier for this processing block

  • kind – The kind of processing script (realtime or batch)

class PhaseDir

Class to hold PhaseDir configuration

Parameters:
  • ra – Right Ascension in degrees (see ADR-49)

  • dec – Declination in degrees (see ADR-49)

  • reference_time – reference_time,

  • reference_frame – Specification of the reference frame or system for a set of pointing coordinates (see ADR-49)

class PolarisationConfiguration

Class to hold Dependencies for Polarisation Configuration

Parameters:
  • polarisations_id – Polarisation definitions id

  • corr_type – corr_type

class ProcessingBlockConfiguration

Class to hold ProcessingBlock configuration

Parameters:
  • pb_id – Processing block ID

  • workflow – Specification of the workflow to be executed along with configuration parameters for the workflow.

  • parameters – Processing script parameters

  • dependencies – Dependencies on other processing blocks

  • sbi_ids – list of scheduling block ids

  • script – Processing script description (dictionary for now)

class SDPConfiguration

Class to hold SDP Configuration

Parameters:
  • eb_id – Execution block ID to associate with processing

  • max_length – Hint about the maximum observation length to support by the SDP.

  • scan_types – Scan types to be supported on subarray

  • processing_blocks – A Processing Block is an atomic unit of data processing for the purpose of SDP’s internal scheduler

  • execution_block – execution_block

  • interface – url string to determine JsonSchema version

  • resources – resources

class SDPWorkflow

Class to hold SDPWorkflows for ProcessingBlock

Create a new SDPWorkflow object.

Parameters:
  • name – The name of the processing script

  • kind – The kind of processing script

  • version – Version of the processing script

class ScanType

Class to hold ScanType configuration

Parameters:
  • scan_type_id – (any scan type)

  • reference_frame – Specification of the reference frame or system for a set of pointing coordinates

  • ra – Right Ascension in degrees

  • dec – Declination in degrees

  • channels – Expected channel configuration.

class ScriptConfiguration

Class to hold ScriptConfiguration

Parameters:
  • name – The name of the processing script

  • kind – The kind of processing script

  • version – Version of the processing script

ska_tmc_cdm.messages.central_node.mccs

class MCCSAllocate

MCCSAllocate is a Python representation of the structured argument for a TMC CentralNode.AssignResourcesRequest.

Parameters:
  • station_ids – stations IDs to allocate

  • channel_blocks – number of channel groups to assign

  • subarray_beam_ids – station beam id’s to allocate

ska_tmc_cdm.messages.mccscontroller.allocate

The allocate module defines a Python object model for the structured JSON given in an MCCSController.Allocate call.

class AllocateRequest

AssignResourcesRequest is the object representation of the JSON argument for an MCCSController.Allocate command.

Parameters:
  • subarray_id – the numeric SubArray ID

  • subarray_beam_ids – subarray beam IDs to allocate to the subarray

  • station_ids – IDs of stations to allocate

  • channel_blocks – channels to allocate

  • interface – the JSON schema this object claims to be compliant with

ska_tmc_cdm.messages.mccscontroller.releaseresources

The allocate module defines a Python object model for the structured JSON that forms the argument for an MCCSController.ReleaseResources call.

class ReleaseResourcesRequest

ReleaseResourcesRequest is the object representation of the JSON argument for an MCCSController.ReleaseResources command.

ska_tmc_cdm.messages.mccssubarray.assigned_resources

class AssignedResources

AssignedResources is the object representation of the JSON returned by the MCCSSubarray.assigned_resources attribute.

Parameters:
  • subarray_beam_ids – subarray beam IDs to allocate to the subarray

  • station_ids – IDs of stations to allocate

  • channel_blocks – channels to allocate

  • interface – the JSON schema this object claims to be compliant with

ska_tmc_cdm.messages.mccssubarray.configure

The mccssubarray.configure module contains a Python object model for the various structured bits of JSON given in an MCCSSubarray.Configure call.

class ConfigureRequest

Class to hold all subarray configuration.

Parameters:
  • stations – a list of station configurations

  • subarray_beams – a list of subarray beam configurations

class StationConfiguration

A class to hold station configuration

Parameters:

station_id – stations id

class SubarrayBeamConfiguration

A class to hold subarray beam configuration attributes

Parameters:
  • subarray_beam_id – subarray beam ID

  • station_ids – station IDs

  • channels – channels to form subarray beam

  • update_rate – frequency of new Az/El during scan

  • sky_coordinates – Az/El specification with rates

  • antenna_weights – antenna weights, 1 per station

  • phase_centre – phase centre of subarray beam

ska_tmc_cdm.messages.mccssubarray.scan

The scan module defines Python object representations of the structured request for an MCCSSubarray.Scan command.

class ScanRequest

ScanRequest represents the request argument for MCCSSubarray.Scan call.

ska_tmc_cdm.messages.subarray_node

The ska_tmc_cdm.messages.subarray_node package holds modules containing classes that represent arguments, requests, and responses for TMC SubArrayNode devices.

ska_tmc_cdm.messages.subarray_node.assigned_resources

TMC Assigned Resources

class AssignedResources

AssignedResources models the structured JSON returned when the MCCSSubarray.assigned_resources Tango attribute is read.

Parameters:
is_empty()
class MCCSAllocation

MCCSAllocation is a Python representation of the structured JSON representing the resources assigned to an MCCS subarray.

Parameters:
  • subarray_beam_ids (List[int]) – the lisdt of SubArray Beam IDs

  • station_ids (List[int]) – stations id’s to MCCSAllocation

  • channel_blocks (List[int]) – channel_blocks

is_empty()

ska_tmc_cdm.messages.subarray_node.configure

ska_tmc_cdm.messages.subarray_node.configure.core

The configure.common module contains simple Python representations of the structured request and response for the TMC SubArrayNode.Configure command.

As configurations become more complex, they may be rehomed in a submodule of this package.

class DishConfiguration

DishConfiguration specifies how SKA MID dishes in a sub-array should be configured. At the moment, this is limited to setting the receiver band.

class PointingConfiguration

PointingConfiguration specifies where the subarray receptors are going to point.

class PointingCorrection(value)[source]

Operation to apply to the pointing correction model. MAINTAIN: continue applying the current pointing correction model UPDATE: wait for (if necessary) and apply new pointing calibration solution RESET: reset the applied pointing correction to the pointing model defaults

class ReceiverBand(value)[source]

ReceiverBand is an enumeration of SKA MID receiver bands.

class Target

Target encapsulates source coordinates and source metadata.

The SubArrayNode ICD specifies that RA and Dec must be provided, hence non-ra/dec frames such as galactic are not supported.

ska_tmc_cdm.messages.subarray_node.configure.csp

ska_tmc_cdm.messages.subarray_node.configure.sdp

ska_tmc_cdm.messages.subarray_node.configure.mccs

ska_tmc_cdm.messages.subarray_node.configure.tmc

ska_tmc_cdm.messages.subarray_node.scan

The scan module defines simple Python representations of the structured request for a TMC SubArrayNode.Scan command.

class ScanRequest

ScanRequest represents the JSON for a SubArrayNode.scan call.

Parameters:

ska_tmc_cdm.schemas

ska_tmc_cdm.schemas.central_node

The schemas.central_node package contains Marshmallow schemas that convert JSON to/from the Python classes contained in ska_tmc_cdm.messages.central_node.

class AssignResourcesRequestSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the AssignResourcesRequest class.

class Meta[source]

marshmallow directives for AssignResourcesRequestSchema.

create_request(data, **_)

Convert parsed JSON back into an AssignResources request object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

AssignResources object populated from data

dish

alias of DishAllocationSchema

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for CBF configuration

mccs

alias of MCCSAllocateSchema

sdp_config

alias of SDPConfigurationSchema

class AssignResourcesResponseSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the AssignResourcesResponse class.

class Meta[source]

Marshmallow directives for AssignResourcesResponseSchema.

create_response(data, **_)

Convert parsed JSON from an AssignResources response back into an AssignResourcesResponse object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

AssignResourcesResponse object populated from data

dish

alias of DishAllocationResponseSchema

class DishAllocationResponseSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the DishAllocation class when received in the response.

create(data, **_)

Convert parsed JSON from an AssignResources response back into a DishAllocation object.

This ‘duplicate’ schema is required as the DishAllocation is found under a different JSON key in the response as compared to the request.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

DishAllocation object populated from data

class DishAllocationSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the DishAllocation class.

create(data, **_)

Convert parsed JSON back into a DishAllocation object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

DishAllocation object populated from data

class MCCSAllocateSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the MCCSAllocate class.

create_mccs_allocate(data, **_)

Convert parsed JSON back into a MCCSAllocate object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

MCCSAllocate object populated from data

class ReleaseResourcesRequestSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the ReleaseResourcesRequest class.

class Meta[source]

Marshmallow directives for ReleaseResourcesRequestSchema.

create_request(data, **_)

Convert parsed JSON from an ReleaseResources request back into an ReleaseResourcesRequest object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

ReleaseResourcesRequest object populated from data

dish

alias of DishAllocationSchema

validate_on_dump(data, **_)

Validating the structure of JSON against schemas and Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for SubArrayNode configuration

class SDPConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the SDPConfiguration class

create_sdp_config(data, **_)

Convert parsed JSON back into a SDPConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

execution_block

alias of ExecutionBlockConfigurationSchema

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

processing_blocks

alias of ProcessingBlockSchema

scan_types

alias of ScanTypeSchema

ska_tmc_cdm.schemas.central_node.assign_resources

The schemas.central_node module defines Marshmallow schemas that map TMC Central Node message classes to/from a JSON representation.

class AssignResourcesRequestSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the AssignResourcesRequest class.

class Meta[source]

marshmallow directives for AssignResourcesRequestSchema.

create_request(data, **_)

Convert parsed JSON back into an AssignResources request object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

AssignResources object populated from data

dish

alias of DishAllocationSchema

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for CBF configuration

mccs

alias of MCCSAllocateSchema

sdp_config

alias of SDPConfigurationSchema

class AssignResourcesResponseSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the AssignResourcesResponse class.

class Meta[source]

Marshmallow directives for AssignResourcesResponseSchema.

create_response(data, **_)

Convert parsed JSON from an AssignResources response back into an AssignResourcesResponse object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

AssignResourcesResponse object populated from data

dish

alias of DishAllocationResponseSchema

ska_tmc_cdm.schemas.central_node.common

The schemas.central_node module defines Marshmallow schemas that map TMC Central Node message classes to/from a JSON representation.

class DishAllocationResponseSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the DishAllocation class when received in the response.

create(data, **_)

Convert parsed JSON from an AssignResources response back into a DishAllocation object.

This ‘duplicate’ schema is required as the DishAllocation is found under a different JSON key in the response as compared to the request.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

DishAllocation object populated from data

class DishAllocationSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the DishAllocation class.

create(data, **_)

Convert parsed JSON back into a DishAllocation object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

DishAllocation object populated from data

ska_tmc_cdm.schemas.central_node.sdp

The schemas.central_node module defines Marshmallow schemas that map TMC Central Node message classes to/from a JSON representation.

class BeamConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the BeamConfiguration class

create_beam_config(data, **_)

Convert parsed JSON back into a BeamConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class ChannelConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the ChannelConfiguration class

create_channel_config(data, **_)

Convert parsed JSON back into a ChannelConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

spectral_windows

alias of ChannelSchema

class ChannelSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the SubBand class.

create_channel(data, **_)

Convert parsed JSON back into a Channel object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SubBand object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class EBScanTypeBeamSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the EBScanTypeBeam class

create_ebscantypebeams_config(data, **_)

Convert parsed JSON back into a EBScanTypeBeam object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class EBScanTypeSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the EBScanTypeBeam class

create_ebscantype_config(data, **_)

Convert parsed JSON back into a EBScanType object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class ExecutionBlockConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the ExecutionBlockConfiguration class

create_executionblock_config(data, **_)

Convert parsed JSON back into a ExecutionBlockConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class FieldConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the FieldConfiguration class

create_polarisation_config(data, **_)

Convert parsed JSON back into a FieldConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

phase_dir

alias of PhaseDirSchema

class PbDependencySchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the PbDepedency class.

create_pb_dependency(data, **_)

Convert parsed JSON back into a PbDependency object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

PbDependency object populated from data

class PhaseDirSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the PhaseDir class

create_phase_dir_config(data, **_)

Convert parsed JSON back into a PhaseDir object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class PolarisationConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the PolarisationConfiguration class

create_polarisation_config(data, **_)

Convert parsed JSON back into a PolarisationConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class ProcessingBlockSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the ProcessingBlock class.

create_processing_block_config(data, **_)

Convert parsed JSON back into a ProcessingBlock object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

PB object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

script

alias of ScriptConfigurationSchema

workflow

alias of SDPWorkflowSchema

class SDPConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marsmallow class for the SDPConfiguration class

create_sdp_config(data, **_)

Convert parsed JSON back into a SDPConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

execution_block

alias of ExecutionBlockConfigurationSchema

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

processing_blocks

alias of ProcessingBlockSchema

scan_types

alias of ScanTypeSchema

class SDPWorkflowSchema(*args: Any, **kwargs: Any)[source]

Represents the type of workflow being configured on the SDP

create_sdp_wf(data, **_)

Convert parsed JSON back into a SDP Workflow object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDP Workflow object populated from data

class ScanTypeSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the ScanType class.

channels

alias of ChannelSchema

create_scan_type(data, **_)

Convert parsed JSON back into a ScanType object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

ScanType object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

class ScriptConfigurationSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the ScriptConfiguration class.

create_executionblock_config(data, **_)

Convert parsed JSON back into a ScriptConfiguration object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

SDPConfiguration object populated from data

filter_nulls(data, **_)

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • _ – kwargs passed by Marshmallow

Returns:

dict suitable for PB configuration

ska_tmc_cdm.schemas.central_node.mccs

The schemas.central_node module defines Marshmallow schemas that map TMC Central Node message classes to/from a JSON representation.

class MCCSAllocateSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the MCCSAllocate class.

create_mccs_allocate(data, **_)

Convert parsed JSON back into a MCCSAllocate object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

MCCSAllocate object populated from data

ska_tmc_cdm.schemas.codec

The codec module contains classes used by clients to marshall CDM classes to and from JSON. This saves the clients having to instantiate and manipulate the Marshmallow schema directly.

class MarshmallowCodec[source]

MarshmallowCodec marshalls and unmarshalls CDM classes.

The mapping of CDM classes to Marshmallow schema is defined in this class.

dumps(obj, validate: bool = True, strictness: int | None = None)[source]

Return a string JSON representation of a CDM instance.

The default strictness of the Telescope Model schema validator can be overridden by supplying the validate argument.

Parameters:
  • obj – the instance to marshall to JSON

  • validate – True to enable schema validation

  • strictness – optional validation strictness level (0=min, 2=max)

Returns:

JSON representation of obj

load_from_file(cls, path, validate: bool = True, strictness: int | None = None)[source]

Load an instance of a CDM class from disk.

Parameters:
  • cls – the class to create from the file

  • path – the path to the file

  • validate – True to enable schema validation

  • strictness – optional validation strictness level (0=min, 2=max)

Returns:

an instance of cls

loads(cdm_class, json_data, validate: bool = True, strictness: int | None = None)[source]

Create an instance of a CDM class from a JSON string.

The default strictness of the Telescope Model schema validator can be overridden by supplying the validate argument.

Parameters:
  • cdm_class – the class to create from the JSON

  • json_data – the JSON to unmarshall

  • validate – True to enable schema validation

  • strictness – optional validation strictness level (0=min, 2=max)

Returns:

an instance of cls

register_mapping(cdm_class)[source]

A decorator that is used to register the mapping between a Marshmallow schema and the CDM class it serialises.

Parameters:

cdm_class – the CDM class this schema maps to

Returns:

the decorator

set_schema(cdm_class, schema_class)[source]

Set the schema for a CDM class.

Parameters:
  • schema_class – Marshmallow schema to map

  • cdm_class – CDM class the schema maps to

ska_tmc_cdm.schemas.mccscontroller.allocate

The schemas.central_node module defines Marshmallow schemas that map MCCSController AllocateRequest message classes to/from their JSON representation.

class AllocateRequestSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the MCCSController AllocateRequest class.

create_allocaterequest(data, **_) pydantic.dataclasses.dataclass

Convert parsed JSON back into an AllocateRequest object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

AllocateRequest object populated from data

ska_tmc_cdm.schemas.mccscontroller.releaseresources

The releaseresources module defines Marshmallow schemas that map MCCSController ReleaseResourcesRequest objects to/from their JSON representation.

class ReleaseResourcesRequestSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the ReleaseResourcesRequest class.

create_request(data, **_)

Convert parsed JSON from an ReleaseResources request back into an ReleaseResourcesRequest object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

ReleaseResourcesRequest object populated from data

ska_tmc_cdm.schemas.mccssubarray.assigned_resources

The assigned_resources module defines Marshmallow schemas that maps the MCCSSubarray.assigned_resources attribute to/from a JSON representation.

class AssignedResourcesSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the MCCSSubarray AssignedResources class.

create_allocaterequest(data, **_) pydantic.dataclasses.dataclass

Convert parsed JSON back into an AssignedResources object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

AssignedResources object populated from data

ska_tmc_cdm.schemas.mccssubarray.configure

The configure module defines Marshmallow schemas that maps the MCCSSubarray.Configure call arguments to/from a JSON representation.

class ConfigureRequestSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the mccssubarray.ConfigureRequest class

create(data, **_) pydantic.dataclasses.dataclass

Convert parsed JSON back into a ConfigureRequest object.

Parameters:
  • data – dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

ConfigureRequest instance populated to match JSON

stations

alias of StationConfigurationSchema

subarray_beams

alias of SubarrayBeamConfigurationSchema

class StationConfigurationSchema(*args: Any, **kwargs: Any)[source]
create(data, **_) pydantic.dataclasses.dataclass

Convert parsed JSON back into a StationConfiguration object.

Parameters:
  • data – dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

StnConfiguration instance populated to match JSON

class SubarrayBeamConfiguration

A class to hold subarray beam configuration attributes

Parameters:
  • subarray_beam_id – subarray beam ID

  • station_ids – station IDs

  • channels – channels to form subarray beam

  • update_rate – frequency of new Az/El during scan

  • sky_coordinates – Az/El specification with rates

  • antenna_weights – antenna weights, 1 per station

  • phase_centre – phase centre of subarray beam

ska_tmc_cdm.schemas.mccssubarray.scan

The schemas module defines Marshmallow schemas that map CDM message classes and data model classes to/from a JSON representation.

class ScanRequestSchema(*args: Any, **kwargs: Any)[source]

Create the Schema for ScanRequest

create_scanrequest(data, **_)

Convert parsed JSON back into a ScanRequest

Parameters:
  • data – dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

ScanRequest instance populated to match JSON

ska_tmc_cdm.schemas.shared

The schemas module defines Marshmallow schemas that are shared by various other serialisation schemas.

class OrderedSchema(*args: Any, **kwargs: Any)[source]

Subclass of Schema, anything inheriting from Schema has the order of its JSON properties respected in the message. Saves adding a Meta class to everything individually

class Meta[source]

marshmallow directive to respect order of JSON properties in message.

class UpperCasedField(*args: Any, **kwargs: Any)[source]

Field that serializes to an upper-case string and deserializes to a lower-case string.

class ValidatingSchema(*args: Any, **kwargs: Any)[source]

ValidatingSchema is a marshmallow schema that calls the appropriate Telescope Model schema validation functions when serialising or deserialising JSON.

semantic_validate_json(data, process_fn=<function ValidatingSchema.<lambda>>, **_)[source]

Validate JSON using the Telescope Model schema.

The process_fn argument can be used to process semantically correct but schematically invalid Python to something equivalent but valid, e.g., to convert a list of Python tuples to a list of lists.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • process_fn – data processing function called before validation

Returns:

validate_json(data, process_fn)[source]

Validate JSON using the Telescope Model schema.

The process_fn argument can be used to process semantically correct but schematically invalid Python to something equivalent but valid, e.g., to convert a list of Python tuples to a list of lists.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • process_fn – data processing function called before validation

Returns:

validate_on_dump(data, process_fn=<function ValidatingSchema.<lambda>>, **_)

Validate the serialised object against the relevant Telescope Model schema.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • process_fn – function to process data before validation

  • _ – unused kwargs passed by Marshmallow

Returns:

dict suitable for writing as a JSON string

validate_on_load(data, process_fn=<function ValidatingSchema.<lambda>>, **_)

Validate the JSON string to deserialise.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values

  • process_fn – function to process data before validation

  • _ – unused kwargs passed by Marshmallow

Returns:

dict suitable for object constructor.

ska_tmc_cdm.schemas.subarray_node

ska_tmc_cdm.schemas.subarray_node.assigned_resources

This module defines Marshmallow schemas that map CDM classes to/from JSON.

class AssignedResourcesSchema(*args: Any, **kwargs: Any)[source]

AssignedResourcesSchema maps the AssignedResources class to/from a JSON representation.

create_assigned_resources(data, **_)

Convert parsed JSON back into an AssignedResources object

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

AssignedResources object populated from data

mccs

alias of MCCSAllocationSchema

class MCCSAllocationSchema(*args: Any, **kwargs: Any)[source]

Marshmallow schema for the MCCSAllocation class.

create_mccs_allocation(data, **_)

Convert parsed JSON back into a MCCSAllocation object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values

  • _ – kwargs passed by Marshmallow

Returns:

MCCSAllocation object populated from data

ska_tmc_cdm.schemas.subarray_node.configure

ska_tmc_cdm.schemas.subarray_node.configure.core

ska_tmc_cdm.schemas.subarray_node.configure.csp

ska_tmc_cdm.schemas.subarray_node.configure.sdp

ska_tmc_cdm.schemas.subarray_node.configure.mccs

ska_tmc_cdm.schemas.subarray_node.configure.tmc

ska_tmc_cdm.schemas.subarray_node.scan