From bd4235b514c8f29c73968cb08f3384977632ee7b Mon Sep 17 00:00:00 2001 From: Mark Ashdown Date: Mon, 14 Apr 2025 16:30:12 +0100 Subject: [PATCH 1/3] DPPT-970: Add get_sdp_releaseres to __all__ --- src/ska_telmodel/sdp/schemas/v0_4.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ska_telmodel/sdp/schemas/v0_4.py b/src/ska_telmodel/sdp/schemas/v0_4.py index fe7731b8..afd33599 100644 --- a/src/ska_telmodel/sdp/schemas/v0_4.py +++ b/src/ska_telmodel/sdp/schemas/v0_4.py @@ -22,6 +22,7 @@ __all__ = [ "get_sdp_configure", "get_sdp_scan", "get_sdp_recvaddrs", + "get_sdp_releaseres", ] -- GitLab From 0e786de5b1bf8c3e681957b19f862630dd155e3e Mon Sep 17 00:00:00 2001 From: Mark Ashdown Date: Mon, 14 Apr 2025 16:45:27 +0100 Subject: [PATCH 2/3] DPPT-970: Add documentation for max_length --- src/ska_telmodel/sdp/schemas/v0_4.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/ska_telmodel/sdp/schemas/v0_4.py b/src/ska_telmodel/sdp/schemas/v0_4.py index afd33599..29a14b4d 100644 --- a/src/ska_telmodel/sdp/schemas/v0_4.py +++ b/src/ska_telmodel/sdp/schemas/v0_4.py @@ -170,14 +170,27 @@ def get_execution_block(version: str, strict: bool) -> TMSchema: strict, schema={ "eb_id": get_eb_name_schema(version, strict), - "max_length": float, - Literal( - "context", - description="Free-form information from OET, see ADR-54", - ): Schema(dict), }, as_reference=True, ) + schema.add_field( + "max_length", + float, + description=cleandoc( + """ + Maximum observation length in seconds. + + Used to ensure that enough buffer capacity is available to capture + data. Resource assignment might fail if we do not have enough + space to guarantee that all data could be captured. + """ + ), + ) + schema.add_field( + "context", + dict, + description="Free-form information from OET, see ADR-54", + ) schema.add_field( "beams", [get_beam(version, strict)], description="Beam parameters" ) -- GitLab From 14e554338c4e84e7cfa21bbded04d25ed8d1cfeb Mon Sep 17 00:00:00 2001 From: Mark Ashdown Date: Fri, 15 Aug 2025 13:24:25 +0100 Subject: [PATCH 3/3] DPPT-970: Add schema for scan type beam --- src/ska_telmodel/sdp/examples/v1_2_dev.py | 17 +++--- src/ska_telmodel/sdp/schemas/v1_2_dev.py | 70 ++++++++++++++++++++--- 2 files changed, 69 insertions(+), 18 deletions(-) diff --git a/src/ska_telmodel/sdp/examples/v1_2_dev.py b/src/ska_telmodel/sdp/examples/v1_2_dev.py index 91c85403..7f04c0d4 100644 --- a/src/ska_telmodel/sdp/examples/v1_2_dev.py +++ b/src/ska_telmodel/sdp/examples/v1_2_dev.py @@ -1,4 +1,4 @@ -"""SDP schema v1.2[DRAFT] examples.""" +"""SDP schema 1.2 examples.""" import copy @@ -20,14 +20,13 @@ __all__ = [ URI = "gitlab://gitlab.com/ska-telescope/ska-low-tmdata?main#tmdata" SDP_ASSIGNRES = copy.deepcopy(SDP_ASSIGNRES_1_1) -SDP_ASSIGNRES["execution_block"].update( - { - "telmodel": { - "source_uris": [URI], - "array_layout_path": "instrument/ska1_low/layout/low-layout.json", - } - } -) +SDP_ASSIGNRES["execution_block"]["telmodel"] = { + "source_uris": [URI], + "array_layout_path": "instrument/ska1_low/layout/low-layout.json", +} +SDP_ASSIGNRES["execution_block"]["scan_types"][1]["beams"]["vis0"][ + "integration_time" +] = 0.125 def get_sdp_assignres(version: str): diff --git a/src/ska_telmodel/sdp/schemas/v1_2_dev.py b/src/ska_telmodel/sdp/schemas/v1_2_dev.py index eea23e84..bb75e1c2 100644 --- a/src/ska_telmodel/sdp/schemas/v1_2_dev.py +++ b/src/ska_telmodel/sdp/schemas/v1_2_dev.py @@ -1,4 +1,6 @@ -"""Version 1.2[DRAFT] of SDP schema""" +"""Version 1.2 of SDP schema""" + +from inspect import cleandoc from ska_telmodel._common import TMSchema, get_telmodel_schema @@ -19,19 +21,69 @@ __all__ = [ ] +def get_scan_type_beam(version: str, strict: bool) -> TMSchema: + schema = TMSchema.new( + "Beam", + version, + strict, + ) + schema.add_opt_field( + "field_id", + str, + description="Field ID.", + ) + schema.add_opt_field( + "channels_id", + str, + description="Channels ID.", + ) + schema.add_opt_field( + "polarisations_id", + str, + description="Polarisations ID.", + ) + schema.add_opt_field( + "integration_time", + float, + description=cleandoc( + """ + Correlator integration time in seconds. + + Applies to visibility beams only. + """ + ), + ) + return schema + + def get_sdp_assignres(version: str, strict: bool) -> TMSchema: - # Get 1.2 dev version + # Get 1.1 version schema = v1_1.get_sdp_assignres(version, strict) - # Adding telmodel key for array layout detail - telmodel_schema = get_telmodel_schema(version, strict) + # Add Telescope Model data sources to EB schema["execution_block"].add_opt_field( "telmodel", - telmodel_schema, - description=""" - Telescope model data to use for subsequent scans - on this subarray (e.g. telescope array layout). - """, + get_telmodel_schema(version, strict), + description=cleandoc( + """ + Telescope model. + + Processing blocks associated with the execution block will use + this to look up information about the telescope (such as the + telescope layout) for the purpose of processing and generating + metadata. The sources should be "pinned" to specific versions to + ensure that processing results are repeatable (see `Data Sources + `_). + """ + ), + ) + + # Update beams in scan type + scan_type = schema["execution_block"]["scan_types"][0] + del scan_type["beams"] + scan_type.add_field( + "beams", + {str: get_scan_type_beam(version, strict)}, ) return schema -- GitLab