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) → <sphinx.ext.autodoc.importer._MockObject object at 0x7ff4b54a3610>[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 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(subarray_id: int = None, dish_allocation: ska_tmc_cdm.messages.central_node.common.DishAllocation = None, sdp_config: ska_tmc_cdm.messages.central_node.sdp.SDPConfiguration = None, mccs: ska_tmc_cdm.messages.central_node.mccs.MCCSAllocate = None, interface: str = None, transaction_id: str = None)[source]

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

classmethod from_dish(subarray_id: int, dish_allocation: ska_tmc_cdm.messages.central_node.common.DishAllocation, sdp_config: ska_tmc_cdm.messages.central_node.sdp.SDPConfiguration = None, interface: str = None, transaction_id: str = None)[source]

Create a new AssignResourcesRequest object.

Parameters:
  • subarray_id – the numeric SubArray ID (1..16)
  • dish_allocation – object holding the DISH resource allocation for this request.
  • sdp_config – sdp configuration
Returns:

AssignResourcesRequest object

classmethod from_mccs(subarray_id: int, mccs: ska_tmc_cdm.messages.central_node.mccs.MCCSAllocate, sdp_config: ska_tmc_cdm.messages.central_node.sdp.SDPConfiguration = None, interface: str = None, transaction_id: str = None)[source]

Create a new AssignResourcesRequest object.

Parameters:
  • subarray_id – the numeric SubArray ID (1..16)
  • mccs – MCCS subarray allocation
  • sdp_config – SDP configuration
  • interface – url string to determine JsonSchema version
Returns:

AssignResourcesRequest object

class AssignResourcesResponse(dish_allocation: ska_tmc_cdm.messages.central_node.common.DishAllocation = None)[source]

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(*_, interface: str = None, transaction_id: str = None, subarray_id: int = None, release_all: bool = False, dish_allocation: Optional[ska_tmc_cdm.messages.central_node.common.DishAllocation] = None)[source]

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

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(receptor_ids: Optional[List[str]] = None)[source]

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

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 SDPWorkflow(name: str, kind: str, version: str)[source]

Class to hold SDPWorkflows for ProcessingBlock

class SDPConfiguration(eb_id: str, max_length: float, scan_types: List[ska_tmc_cdm.messages.central_node.sdp.ScanType], processing_blocks: List[ska_tmc_cdm.messages.central_node.sdp.ProcessingBlockConfiguration], interface: str = None)[source]

Class to hold SDPConfiguration

class ProcessingBlockConfiguration(pb_id: str, workflow: ska_tmc_cdm.messages.central_node.sdp.SDPWorkflow, parameters: Dict[KT, VT], dependencies: List[ska_tmc_cdm.messages.central_node.sdp.PbDependency] = None)[source]

Class to hold ProcessingBlock configuration

class PbDependency(pb_id: str, pb_type: List[str])[source]

Class to hold Dependencies for ProcessingBlock

class ScanType(scan_type_id, reference_frame: str, ra: str, dec: str, channels: List[ska_tmc_cdm.messages.central_node.sdp.Channel])[source]

Class to hold ScanType configuration

class Channel(count: int, start: int, stride: int, freq_min: float, freq_max: float, link_map: List[List[T]])[source]

Class to hold Channels for ScanType

ska_tmc_cdm.messages.central_node.mccs

class MCCSAllocate(station_ids: Sequence[Sequence[int]], channel_blocks: Sequence[int], subarray_beam_ids: Sequence[int])[source]

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

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(*, interface: Optional[str] = 'https://schema.skao.int/ska-low-mccs-assignresources/2.0', subarray_id: int, subarray_beam_ids: List[int] = None, station_ids: List[List[int]] = None, channel_blocks: List[int] = None)[source]

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

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(*, interface: Optional[str] = 'https://schema.skao.int/ska-low-mccs-releaseresources/2.0', subarray_id: int, release_all: bool)[source]

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

ska_tmc_cdm.messages.mccssubarray.assigned_resources

class AssignedResources(*, interface: Optional[str] = 'https://schema.skao.int/ska-low-mccs-assignedresources/2.0', subarray_beam_ids: List[int] = None, station_ids: List[List[int]] = None, channel_blocks: List[int] = None)[source]

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

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(*, interface: Optional[str] = 'https://schema.skao.int/ska-low-mccs-configure/2.0', stations: List[ska_tmc_cdm.messages.mccssubarray.configure.StationConfiguration], subarray_beams: List[ska_tmc_cdm.messages.mccssubarray.configure.SubarrayBeamConfiguration])[source]

Class to hold all subarray configuration.

class StationConfiguration(station_id: int)[source]

A class to hold station configuration

class SubarrayBeamConfiguration(*, subarray_beam_id: int, station_ids: List[int], update_rate: float, channels: List[List[int]], sky_coordinates: List[float], antenna_weights: List[float], phase_centre: List[float])[source]

A class to hold subarray beam configuration attributes

ska_tmc_cdm.messages.mccssubarray.scan

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

class ScanRequest(*, interface: Optional[str] = 'https://schema.skao.int/ska-low-mccs-scan/2.0', scan_id: int, start_time: float)[source]

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 MCCSAllocation(subarray_beam_ids: List[int], station_ids: List[List[int]], channel_blocks: List[int])[source]

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

is_empty()[source]

Determine that the current MCCSAllocation instance is empty (none of the attribute Lists are populated)

class AssignedResources(*, interface: Optional[str] = 'https://schema.skao.int/ska-low-tmc-assignedresources/2.0', mccs: ska_tmc_cdm.messages.subarray_node.assigned_resources.MCCSAllocation)[source]

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

is_empty() → bool[source]

Determine that the current MCCSAllocation instance is empty (none of the attribute Lists are populated)

ska_tmc_cdm.messages.subarray_node.configure

The configure package contains modules that define Python classes for all of the permissible arguments for a SubArrayNode.configure() call.

class ConfigureRequest(pointing: ska_tmc_cdm.messages.subarray_node.configure.core.PointingConfiguration = None, dish: ska_tmc_cdm.messages.subarray_node.configure.core.DishConfiguration = None, sdp: ska_tmc_cdm.messages.subarray_node.configure.sdp.SDPConfiguration = None, csp: ska_tmc_cdm.messages.subarray_node.configure.csp.CSPConfiguration = None, mccs: ska_tmc_cdm.messages.subarray_node.configure.mccs.MCCSConfiguration = None, tmc: ska_tmc_cdm.messages.subarray_node.configure.tmc.TMCConfiguration = None, interface: Optional[str] = 'https://schema.skao.int/ska-tmc-configure/2.0', transaction_id: Optional[str] = None)[source]

ConfigureRequest encapsulates the arguments required for the TMC SubArrayNode.Configure() command.

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 PointingConfiguration(target: ska_tmc_cdm.messages.subarray_node.configure.core.Target)[source]

PointingConfiguration specifies where the subarray receptors are going to point.

class Target(ra, dec, target_name='', reference_frame='icrs', unit=('hourangle', 'deg'))[source]

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.

class ReceiverBand[source]

ReceiverBand is an enumeration of SKA MID receiver bands.

class DishConfiguration(receiver_band: ska_tmc_cdm.messages.subarray_node.configure.core.ReceiverBand)[source]

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

ska_tmc_cdm.messages.subarray_node.configure.csp

The configure.csp module contains Python classes that represent the various aspects of CSP configuration that may be specified in a SubArrayNode.configure command.

class CSPConfiguration(interface: str = None, subarray_config: ska_tmc_cdm.messages.subarray_node.configure.csp.SubarrayConfiguration = None, common_config: ska_tmc_cdm.messages.subarray_node.configure.csp.CommonConfiguration = None, cbf_config: ska_tmc_cdm.messages.subarray_node.configure.csp.CBFConfiguration = None, pst_config: ska_tmc_cdm.messages.subarray_node.configure.csp.PSTConfiguration = None, pss_config: ska_tmc_cdm.messages.subarray_node.configure.csp.PSSConfiguration = None)[source]

Class to hold all CSP configuration.

class FSPConfiguration(fsp_id: int, function_mode: ska_tmc_cdm.messages.subarray_node.configure.csp.FSPFunctionMode, frequency_slice_id: int, integration_factor: int, zoom_factor: int, channel_averaging_map: List[Tuple] = None, output_link_map: List[Tuple] = None, channel_offset: int = None, zoom_window_tuning: int = None)[source]

FSPConfiguration defines the configuration for a CSP Frequency Slice Processor.

class FSPFunctionMode[source]

FSPFunctionMode is an enumeration of the available FSP modes.

class CBFConfiguration(fsp_configs: List[ska_tmc_cdm.messages.subarray_node.configure.csp.FSPConfiguration], vlbi_config: ska_tmc_cdm.messages.subarray_node.configure.csp.VLBIConfiguration = None)[source]

Class to hold all FSP and VLBI configurations.

class SubarrayConfiguration(subarray_name: str)[source]

Class to hold the parameters relevant only for the current sub-array device.

class CommonConfiguration(config_id: str, frequency_band: ska_tmc_cdm.messages.subarray_node.configure.core.ReceiverBand, subarray_id: int = None, band_5_tuning: Optional[List[float]] = None)[source]

Class to hold the CSP sub-elements.

ska_tmc_cdm.messages.subarray_node.configure.sdp

The configure.sdp module contains Python classes that represent the various aspects of SDP configuration that may be specified in a SubArrayNode.configure command.

class SDPConfiguration(*, interface: Optional[str] = 'https://schema.skao.int/ska-sdp-configure/0.3', scan_type: str)[source]

Message class to hold SDP configuration aspect of a TMC SubArrayNode.Configure call.

ska_tmc_cdm.messages.subarray_node.configure.mccs

The configure.mccs module contains Python classes that represent the various aspects of MCCS configuration that may be specified in a SubArray.configure command.

class MCCSConfiguration(*_, station_configs: List[ska_tmc_cdm.messages.subarray_node.configure.mccs.StnConfiguration], subarray_beam_configs: List[ska_tmc_cdm.messages.subarray_node.configure.mccs.SubarrayBeamConfiguration])[source]

Class to hold all subarray configuration.

class StnConfiguration(station_id: int)[source]

A class to hold station configuration configuration

class SubarrayBeamConfiguration(subarray_beam_id: int, station_ids: List[int], channels: List[List[int]], update_rate: float, target: ska_tmc_cdm.messages.subarray_node.configure.mccs.SubarrayBeamTarget, antenna_weights: List[float], phase_centre: List[float])[source]

A class to hold subarray_beam configuration attributes

class SubarrayBeamTarget(az: float, el: float, target_name: str, reference_frame: str)[source]

Target encapsulates source coordinates and source metadata.

The SubArrayNode ICD specifies that az and el must be provided

ska_tmc_cdm.messages.subarray_node.configure.tmc

Configuration specific to TMC. scan_duration (in seconds) is the duration to be used for all scan commands following this configuration.

class TMCConfiguration(scan_duration: datetime.timedelta)[source]

Class to hold TMC configuration

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(*, interface: Optional[str] = 'https://schema.skao.int/ska-tmc-scan/2.0', transaction_id: Optional[str] = None, scan_id: int)[source]

ScanRequest represents the JSON for a SubArrayNode.scan call.

ska_tmc_cdm.schemas

The schemas for the SKA Configuration Data Model (CDM).

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, **kwargs)[source]

Marshmallow schema for the AssignResourcesRequest class.

class Meta[source]

marshmallow directives for AssignResourcesRequestSchema.

create_request(data, **_)[source]

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

validate_on_dump(data, **_)[source]

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 AssignResourcesResponseSchema(*args, **kwargs)[source]

Marshmallow schema for the AssignResourcesResponse class.

class Meta[source]

Marshmallow directives for AssignResourcesResponseSchema.

create_response(data, **_)[source]

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

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

Marshmallow schema for the ReleaseResourcesRequest class.

class Meta[source]

Marshmallow directives for ReleaseResourcesRequestSchema.

create_request(data, **_)[source]

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

filter_args(data, **_)[source]

Filter Marshmallow’s JSON based on the value of release_all.

If release_all is True, other resource definitions should be stripped from the request. If release_all for MID set to False, the ‘release_all’ key itself should be stripped. If release_all_low for LOW set to False, the ‘release_all_low’ key itself should be stripped.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • _ – kwargs passed by Marshmallow
Returns:

dict suitable for request submission

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

Marshmallow schema for the DishAllocation class.

create(data, **_)[source]

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 DishAllocationResponseSchema(*args, **kwargs)[source]

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

create(data, **_)[source]

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 SDPConfigurationSchema(*args, **kwargs)[source]

Marsmallow class for the SDPConfiguration class

create_sdp_config(data, **_)[source]

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

filter_nulls(data, **_)[source]

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 MCCSAllocateSchema(*args, **kwargs)[source]

Marshmallow schema for the MCCSAllocate class.

create_mccs_allocate(data, **_)[source]

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.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, **kwargs)[source]

Marshmallow schema for the AssignResourcesRequest class.

class Meta[source]

marshmallow directives for AssignResourcesRequestSchema.

create_request(data, **_)[source]

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

validate_on_dump(data, **_)[source]

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 AssignResourcesResponseSchema(*args, **kwargs)[source]

Marshmallow schema for the AssignResourcesResponse class.

class Meta[source]

Marshmallow directives for AssignResourcesResponseSchema.

create_response(data, **_)[source]

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

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 DishAllocationSchema(*args, **kwargs)[source]

Marshmallow schema for the DishAllocation class.

create(data, **_)[source]

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 DishAllocationResponseSchema(*args, **kwargs)[source]

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

create(data, **_)[source]

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

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 ScanTypeSchema(*args, **kwargs)[source]

Marshmallow schema for the ScanType class.

create_scan_type(data, **_)[source]

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

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

Represents the type of workflow being configured on the SDP

create_sdp_wf(data, **_)[source]

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 PbDependencySchema(*args, **kwargs)[source]

Marshmallow schema for the PbDepedency class.

create_pb_dependency(data, **_)[source]

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 ChannelSchema(*args, **kwargs)[source]

Marshmallow schema for the SubBand class.

create_channel(data, **_)[source]

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

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

Marshmallow schema for the ProcessingBlock class.

create_processing_block_config(data, **_)[source]

Convert parsed JSON back into a PB object.

Parameters:
  • data – Marshmallow-provided dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

PB object populated from data

filter_nulls(data, **_)[source]

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 SDPConfigurationSchema(*args, **kwargs)[source]

Marsmallow class for the SDPConfiguration class

create_sdp_config(data, **_)[source]

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

filter_nulls(data, **_)[source]

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, **kwargs)[source]

Marshmallow schema for the MCCSAllocate class.

create_mccs_allocate(data, **_)[source]

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: Optional[int] = 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: Optional[int] = 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: Optional[int] = 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, **kwargs)[source]

Marshmallow schema for the MCCSController AllocateRequest class.

create_allocaterequest(data, **_) → ska_tmc_cdm.messages.mccscontroller.allocate.AllocateRequest[source]

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, **kwargs)[source]

Marshmallow schema for the ReleaseResourcesRequest class.

create_request(data, **_)[source]

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, **kwargs)[source]

Marshmallow schema for the MCCSSubarray AssignedResources class.

create_allocaterequest(data, **_) → ska_tmc_cdm.messages.mccssubarray.assigned_resources.AssignedResources[source]

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, **kwargs)[source]

Marshmallow schema for the mccssubarray.ConfigureRequest class

create(data, **_) → ska_tmc_cdm.messages.mccssubarray.configure.ConfigureRequest[source]
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

class StationConfigurationSchema(*args, **kwargs)[source]
create(data, **_) → ska_tmc_cdm.messages.mccssubarray.configure.StationConfiguration[source]
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(*, subarray_beam_id: int, station_ids: List[int], update_rate: float, channels: List[List[int]], sky_coordinates: List[float], antenna_weights: List[float], phase_centre: List[float])[source]

A class to hold subarray beam configuration attributes

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, **kwargs)[source]

Create the Schema for ScanRequest

create_scanrequest(data, **_)[source]

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 UpperCasedField(*args, **kwargs)[source]

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

class OrderedSchema(*args, **kwargs)[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 ValidatingSchema(*args, **kwargs)[source]

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

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>>, **_)[source]

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>>, **_)[source]

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

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

ska_tmc_cdm.schemas.subarray_node.assigned_resources

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

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

Marshmallow schema for the MCCSAllocation class.

create_mccs_allocation(data, **_)[source]

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

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

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

create_assigned_resources(data, **_)[source]

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.subarray_node.configure

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

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

Marshmallow schema for the subarray_node.ConfigureRequest class.

create_configuration(data, **_)[source]

Converted parsed JSON backn into a subarray_node.ConfigureRequest object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

ConfigurationRequest instance populated to match JSON

filter_nulls(data, **_)[source]

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 DishConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.DishConfiguration class.

convert(dish_configuration: ska_tmc_cdm.messages.subarray_node.configure.core.DishConfiguration, **_)[source]

Process DishConfiguration instance so that it is ready for conversion to JSON.

Parameters:
  • dish_configuration – the dish configuration
  • _ – kwargs passed by Marshmallow
Returns:

DishConfiguration instance populated to match JSON

create_dish_configuration(data, **_)[source]

Converted parsed JSON back into a subarray_node.DishConfiguration object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

DishConfiguration instance populated to match JSON

class PointingSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.Pointing class.

create(data, **_)[source]

Convert parsed JSON back into a subarray_node.Pointing object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

Pointing instance populated to match JSON

class TargetSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.Target class

convert_to_icrs(target: ska_tmc_cdm.messages.subarray_node.configure.core.Target, **_)[source]

Process Target co-ordinates by converting them to ICRS frame before the JSON marshalling process begins.

Parameters:
  • target – Target instance to process
  • _ – kwargs passed by Marshallow
Returns:

SexagesimalTarget with ICRS ra/dec expressed in hms/dms

create_target(data, **_)[source]

Convert parsed JSON back into a Target object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

Target instance populated to match JSON

class CSPConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.CSPConfiguration class

create(data, **_)[source]
Convert parsed JSON back into a CSPConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

CSPConfiguration instance populated to match JSON

validate_on_dump(data, **_)[source]

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 SubarrayConfigurationSchema(*args, **kwargs)[source]
create(data, **_)[source]
Convert parsed JSON back into a SubarrayConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

SubarrayConfiguration instance populated to match JSON

Return type:

SubarrayConfiguration

class CommonConfigurationSchema(*args, **kwargs)[source]
convert(common_configuration: ska_tmc_cdm.messages.subarray_node.configure.csp.CommonConfiguration, **_)[source]

Process CommonConfiguration instance so that it is ready for conversion to JSON.

Parameters:
  • CommonConfiguration – Common configuration to process
  • _ – kwargs passed by Marshmallow
Returns:

CommonConfiguration instance populated to match JSON

create(data, **_)[source]
Convert parsed JSON back into a CSPConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

CommonConfiguration instance populated to match JSON

filter_nulls(data, **_)[source]

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • _ – kwargs passed by Marshmallow
Returns:

dict suitable for FSP configuration

class CBFConfigurationSchema(*args, **kwargs)[source]
create(data, **_)[source]
Convert parsed JSON back into a CBFConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

CBFConfiguration instance populated to match JSON

Return type:

CBFConfiguration

class FSPConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.FSPConfiguration class

convert(fsp_configuration: ska_tmc_cdm.messages.subarray_node.configure.csp.FSPConfiguration, **_)[source]

Process FSPConfiguration instance so that it is ready for conversion to JSON.

Parameters:
  • fsp_configuration – FSP configuration to process
  • _ – kwargs passed by Marshmallow
Returns:

FspConfiguration instance populated to match JSON

create(data, **_)[source]
Convert parsed JSON back into a FSPConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

FSPConfiguration instance populated to match JSON

filter_nulls(data, **_)[source]

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • _ – kwargs passed by Marshmallow
Returns:

dict suitable for FSP configuration

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

Marshmallow class for the SDPConfiguration class

create_sdp_configuration(data, **_)[source]

Convert parsed JSON back into a set containing all the scans :param data: dict containing parsed JSON values :param _: kwargs passed by Marshmallow :return: SDPConfiguration instance populated to match JSON

class MCCSConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.MCCSConfiguration class

create(data, **_)[source]
Convert parsed JSON back into a MCCSConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

MCCSConfiguration instance populated to match JSON

Return type:

MCCSConfiguration

filter_nulls_and_validate_schema(data, **_)[source]

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

validate_json(data, process_fn=<function MCCSConfigurationSchema.<lambda>>)[source]

validating the structure of JSON against schemas

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • function (lambda) – use for converting list of tuples to list of list
Returns:

validate_schema(data, **_)[source]

validating the structure of JSON against schemas

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • _ – kwargs passed by Marshmallow
Returns:

dict suitable for CSP configuration

class StnConfigurationSchema(*args, **kwargs)[source]
create(data, **_)[source]
Convert parsed JSON back into a StnConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

StnConfiguration instance populated to match JSON

Return type:

StnConfiguration

class SubarrayBeamConfigurationSchema(*args, **kwargs)[source]
create(data, **_) → ska_tmc_cdm.messages.subarray_node.configure.mccs.SubarrayBeamConfiguration[source]
Convert parsed JSON back into a SubarrayBeamConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

SubarrayBeamConfiguration instance populated to match JSON

ska_tmc_cdm.schemas.subarray_node.configure.core

The schemas module defines Marshmallow schemas that map shared CDM message classes for SubArrayNode configuration to/from a JSON representation.

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

Marshmallow schema for the subarray_node.ConfigureRequest class.

create_configuration(data, **_)[source]

Converted parsed JSON backn into a subarray_node.ConfigureRequest object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

ConfigurationRequest instance populated to match JSON

filter_nulls(data, **_)[source]

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 DishConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.DishConfiguration class.

convert(dish_configuration: ska_tmc_cdm.messages.subarray_node.configure.core.DishConfiguration, **_)[source]

Process DishConfiguration instance so that it is ready for conversion to JSON.

Parameters:
  • dish_configuration – the dish configuration
  • _ – kwargs passed by Marshmallow
Returns:

DishConfiguration instance populated to match JSON

create_dish_configuration(data, **_)[source]

Converted parsed JSON back into a subarray_node.DishConfiguration object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

DishConfiguration instance populated to match JSON

class PointingSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.Pointing class.

create(data, **_)[source]

Convert parsed JSON back into a subarray_node.Pointing object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

Pointing instance populated to match JSON

class TargetSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.Target class

convert_to_icrs(target: ska_tmc_cdm.messages.subarray_node.configure.core.Target, **_)[source]

Process Target co-ordinates by converting them to ICRS frame before the JSON marshalling process begins.

Parameters:
  • target – Target instance to process
  • _ – kwargs passed by Marshallow
Returns:

SexagesimalTarget with ICRS ra/dec expressed in hms/dms

create_target(data, **_)[source]

Convert parsed JSON back into a Target object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

Target instance populated to match JSON

ska_tmc_cdm.schemas.subarray_node.configure.csp

This module defines Marshmallow schemas that map the CDM classes for SubArrayNode CSP configuration to/from JSON.

class CSPConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.CSPConfiguration class

create(data, **_)[source]
Convert parsed JSON back into a CSPConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

CSPConfiguration instance populated to match JSON

validate_on_dump(data, **_)[source]

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 FSPConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.FSPConfiguration class

convert(fsp_configuration: ska_tmc_cdm.messages.subarray_node.configure.csp.FSPConfiguration, **_)[source]

Process FSPConfiguration instance so that it is ready for conversion to JSON.

Parameters:
  • fsp_configuration – FSP configuration to process
  • _ – kwargs passed by Marshmallow
Returns:

FspConfiguration instance populated to match JSON

create(data, **_)[source]
Convert parsed JSON back into a FSPConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

FSPConfiguration instance populated to match JSON

filter_nulls(data, **_)[source]

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • _ – kwargs passed by Marshmallow
Returns:

dict suitable for FSP configuration

class SubarrayConfigurationSchema(*args, **kwargs)[source]
create(data, **_)[source]
Convert parsed JSON back into a SubarrayConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

SubarrayConfiguration instance populated to match JSON

Return type:

SubarrayConfiguration

class CommonConfigurationSchema(*args, **kwargs)[source]
convert(common_configuration: ska_tmc_cdm.messages.subarray_node.configure.csp.CommonConfiguration, **_)[source]

Process CommonConfiguration instance so that it is ready for conversion to JSON.

Parameters:
  • CommonConfiguration – Common configuration to process
  • _ – kwargs passed by Marshmallow
Returns:

CommonConfiguration instance populated to match JSON

create(data, **_)[source]
Convert parsed JSON back into a CSPConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

CommonConfiguration instance populated to match JSON

filter_nulls(data, **_)[source]

Filter out null values from JSON.

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • _ – kwargs passed by Marshmallow
Returns:

dict suitable for FSP configuration

class CBFConfigurationSchema(*args, **kwargs)[source]
create(data, **_)[source]
Convert parsed JSON back into a CBFConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

CBFConfiguration instance populated to match JSON

Return type:

CBFConfiguration

ska_tmc_cdm.schemas.subarray_node.configure.sdp

This module defines Marshmallow schemas that map the SDPConfiguration message classes to/from JSON.

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

Marshmallow class for the SDPConfiguration class

create_sdp_configuration(data, **_)[source]

Convert parsed JSON back into a set containing all the scans :param data: dict containing parsed JSON values :param _: kwargs passed by Marshmallow :return: SDPConfiguration instance populated to match JSON

ska_tmc_cdm.schemas.subarray_node.configure.mccs

This module defines Marshmallow schemas that map the CDM classes for SubArrayNode MCCS configuration to/from JSON.

class MCCSConfigurationSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.MCCSConfiguration class

create(data, **_)[source]
Convert parsed JSON back into a MCCSConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

MCCSConfiguration instance populated to match JSON

Return type:

MCCSConfiguration

filter_nulls_and_validate_schema(data, **_)[source]

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

validate_json(data, process_fn=<function MCCSConfigurationSchema.<lambda>>)[source]

validating the structure of JSON against schemas

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • function (lambda) – use for converting list of tuples to list of list
Returns:

validate_schema(data, **_)[source]

validating the structure of JSON against schemas

Parameters:
  • data – Marshmallow-provided dict containing parsed object values
  • _ – kwargs passed by Marshmallow
Returns:

dict suitable for CSP configuration

class StnConfigurationSchema(*args, **kwargs)[source]
create(data, **_)[source]
Convert parsed JSON back into a StnConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

StnConfiguration instance populated to match JSON

Return type:

StnConfiguration

class SubarrayBeamConfigurationSchema(*args, **kwargs)[source]
create(data, **_) → ska_tmc_cdm.messages.subarray_node.configure.mccs.SubarrayBeamConfiguration[source]
Convert parsed JSON back into a SubarrayBeamConfiguration object.
Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

SubarrayBeamConfiguration instance populated to match JSON

class SubarrayBeamTargetSchema(*args, **kwargs)[source]

Marshmallow schema for the subarray_node.Target class

create_target(data, **_)[source]

Convert parsed JSON back into a Target object.

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

Target instance populated to match JSON

ska_tmc_cdm.schemas.subarray_node.configure.tmc

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

class TMCConfigurationSchema(*args, **kwargs)[source]

Create the Schema for ScanDuration using timedelta

convert_scan_duration_number_to_timedelta(data, **_)[source]

Convert parsed JSON back into a TMConfiguration

Parameters:
  • data – dict containing parsed JSON values
  • _ – kwargs passed by Marshmallow
Returns:

TMCConfiguration instance populated to match JSON

convert_scan_duration_timedelta_to_float(data: ska_tmc_cdm.messages.subarray_node.configure.tmc.TMCConfiguration, **_)[source]

Process scan_duration and convert it to a float

Parameters:
  • data – the scan_duration timedelta
  • _ – kwargs passed by Marshallow
Returns:

float converted

ska_tmc_cdm.schemas.subarray_node.scan

The ska_tmc_cdm.schemas.subarray_node.scan module contains Marshmallow schema that map ska_tmc_cdm.schemas.subarray_node.scan message classes to/from JSON.

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

ScanRequestSchema is the Marshmallow schema that marshals a ScanRequest to/from JSON.

create_scanrequest(data, **_)[source]

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

filter_nulls(data, **_)[source]

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