API

ska.cdm.jsonschema

ska.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 0x7f3fea9aabd0>[source]

Retrieve JSON Schemas from remote server.

Parameters:uri – Interface Version URI
Returns:Interface schema
static validate_schema(uri: str, instance: dict)[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.

ska.cdm.messages

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

ska.cdm.messages.central_node

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

ska.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.cdm.messages.central_node.common.DishAllocation = None, sdp_config: ska.cdm.messages.central_node.sdp.SDPConfiguration = None, mccs_allocate: ska.cdm.messages.central_node.mccs.MCCSAllocate = 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.cdm.messages.central_node.common.DishAllocation, sdp_config: ska.cdm.messages.central_node.sdp.SDPConfiguration = 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(mccs_allocate: ska.cdm.messages.central_node.mccs.MCCSAllocate)[source]

Create a new AssignResourcesRequest object.

Parameters:mccs_allocate – MCCS subarray allocation
Returns:AssignResourcesRequest object
class AssignResourcesResponse(dish_allocation: ska.cdm.messages.central_node.common.DishAllocation = None)[source]

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

ska.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(subarray_id: int, release_all: bool = False, dish_allocation: Optional[ska.cdm.messages.central_node.common.DishAllocation] = None)[source]

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

ska.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.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(workflow_id: str, workflow_type: str, version: str)[source]

Class to hold SDPWorkflows for ProcessingBlock

class SDPConfiguration(sdp_id: str, max_length: float, scan_types: List[ska.cdm.messages.central_node.sdp.ScanType], processing_blocks: List[ska.cdm.messages.central_node.sdp.ProcessingBlockConfiguration])[source]

Class to hold SDPConfiguration

class ProcessingBlockConfiguration(pb_id: str, workflow: ska.cdm.messages.central_node.sdp.SDPWorkflow, parameters: Dict[KT, VT], dependencies: List[ska.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(st_id, coordinate_system: str, ra: str, dec: str, channels: List[ska.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.cdm.messages.central_node.mccs

class MCCSAllocate(subarray_id: int, station_ids: List[int], channels: List[int], station_beam_ids: List[int])[source]

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

ska.cdm.messages.subarray_node

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

ska.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.cdm.messages.subarray_node.configure.core.PointingConfiguration = None, dish: ska.cdm.messages.subarray_node.configure.core.DishConfiguration = None, sdp: ska.cdm.messages.subarray_node.configure.sdp.SDPConfiguration = None, csp: ska.cdm.messages.subarray_node.configure.csp.CSPConfiguration = None, mccs: ska.cdm.messages.subarray_node.configure.mccs.MCCSConfiguration = None, tmc: ska.cdm.messages.subarray_node.configure.tmc.TMCConfiguration = None)[source]

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

ska.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.cdm.messages.subarray_node.configure.core.Target)[source]

PointingConfiguration specifies where the subarray receptors are going to point.

class Target(ra, dec, name='', 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.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.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(csp_id: str = None, frequency_band: ska.cdm.messages.subarray_node.configure.core.ReceiverBand = None, fsp_configs: List[ska.cdm.messages.subarray_node.configure.csp.FSPConfiguration] = None, interface_url: str = None, subarray_config: ska.cdm.messages.subarray_node.configure.csp.SubarrayConfiguration = None, common_config: ska.cdm.messages.subarray_node.configure.csp.CommonConfiguration = None, cbf_config: ska.cdm.messages.subarray_node.configure.csp.CBFConfiguration = None, pst_config: ska.cdm.messages.subarray_node.configure.csp.PSTConfiguration = None, pss_config: ska.cdm.messages.subarray_node.configure.csp.PSSConfiguration = None)[source]

Class to hold all CSP configuration.

class FSPConfiguration(fsp_id: int, function_mode: ska.cdm.messages.subarray_node.configure.csp.FSPFunctionMode, frequency_slice_id: int, integration_time: int, corr_bandwidth: int, channel_averaging_map: List[Tuple] = None, output_link_map: List[Tuple] = None, fsp_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.cdm.messages.subarray_node.configure.csp.FSPConfiguration], vlbi_config: ska.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(csp_id: str, frequency_band: ska.cdm.messages.subarray_node.configure.core.ReceiverBand, subarray_id: int = None)[source]

Class to hold the CSP sub-elements.

ska.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(scan_type: str)[source]

Class to hold SDP configuration

ska.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.cdm.messages.subarray_node.configure.mccs.StnConfiguration], station_beam_configs: List[ska.cdm.messages.subarray_node.configure.mccs.StnBeamConfiguration])[source]

Class to hold all subarray configuration.

class StnConfiguration(station_id: int)[source]

A class to hold station configuration configuration

class StnBeamConfiguration(station_beam_id: int, station_ids: List[int], channels: List[int], update_rate: float, sky_coordinates: List[float])[source]

A class to hold station_beam configuration attributes

ska.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.cdm.messages.subarray_node.scan

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

class ScanRequest(scan_id: int)[source]

ScanRequest represents the request argument for SubArrayNode.scan call.

ska.cdm.schemas

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

ska.cdm.schemas.central_node

The schemas.central_node package contains Marshmallow schemas that convert JSON to/from the Python classes contained in ska.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

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 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 if False, the ‘release_all’ 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

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

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 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 if False, the ‘release_all’ key itself should be stripped.

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

dict suitable for request submission

ska.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.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

ska.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.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)[source]

Return a string JSON representation of a CDM instance.

Parameters:
  • obj – the instance to marshall to JSON
  • validate – default value set to true for schema validation
Returns:

a JSON string

load_from_file(cls, path, validate: bool = True)[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 – default value set to true for schema validation
Returns:

an instance of cls

loads(cdm_class, json_data, validate: bool = True)[source]

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

Parameters:
  • cdm_class – the class to create from the JSON
  • json_data – the JSON to unmarshall
  • validate – default value set to true for schema validation
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.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.

ska.cdm.schemas.subarray_node

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

ska.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.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.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

convert(csp_configuration: ska.cdm.messages.subarray_node.configure.csp.CSPConfiguration, **_)[source]

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

Parameters:
  • csp_configuration – CSP configuration to process
  • _ – kwargs passed by Marshmallow
Returns:

CSPConfiguration 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:

CSPConfiguration instance populated to match JSON

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 CSPConfigurationSchema.<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 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.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

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

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

StnBeamConfiguration instance populated to match JSON

Return type:

StnBeamConfiguration

ska.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.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.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.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

convert(csp_configuration: ska.cdm.messages.subarray_node.configure.csp.CSPConfiguration, **_)[source]

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

Parameters:
  • csp_configuration – CSP configuration to process
  • _ – kwargs passed by Marshmallow
Returns:

CSPConfiguration 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:

CSPConfiguration instance populated to match JSON

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

Marshmallow schema for the subarray_node.FSPConfiguration class

convert(fsp_configuration: ska.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.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

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.cdm.schemas.subarray_node.configure.sdp

This module defines Marshmallow schemas that map CDM the message classes for SDP configuration to and from a JSON representation.

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

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

StnBeamConfiguration instance populated to match JSON

Return type:

StnBeamConfiguration

ska.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.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.cdm.schemas.subarray_node.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 ScanDuration using timedelta

create_scan_request(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