From 8a2219c5e319f7f2dce5eebf51570fa15ada7998 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20K=C3=BCnsem=C3=B6ller?=
 <jkuensem@physik.uni-bielefeld.de>
Date: Thu, 21 Dec 2023 16:06:12 +0100
Subject: [PATCH] TMSS-2824: add Cobalt release setting to observation tasks
 and subtask JSON, adapt parset adapter and Lobster

---
 .../backend/services/lobster/lib/config.py    |   5 +-
 .../services/lobster/lib/message_handler.py   |   7 +-
 .../src/tmss/tmssapp/adapters/parset.py       |   2 +-
 .../common_schema_template/correlator-9.json  |  72 +++
 .../observation/observation_control-12.json   | 575 ++++++++++++++++++
 5 files changed, 656 insertions(+), 5 deletions(-)
 create mode 100644 SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/correlator-9.json
 create mode 100644 SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-12.json

diff --git a/SAS/TMSS/backend/services/lobster/lib/config.py b/SAS/TMSS/backend/services/lobster/lib/config.py
index 34b3da653bf..85085f15cef 100644
--- a/SAS/TMSS/backend/services/lobster/lib/config.py
+++ b/SAS/TMSS/backend/services/lobster/lib/config.py
@@ -34,7 +34,8 @@ def station_to_host(station: str, port: int=10000) -> str:
 COBALT_HEADNODE = "cbm206.control.lofar" if isProductionEnvironment() else "localhost"
 
 # Storage location for parsets on COBALT_HEADNODE
-COBALT_PARSET_DIR = "/opt/lofar/var/run"
+COBALT_PARSET_DIR_TEMPLATE = "/opt/lofar-versions/%(cobalt_release)s/var/run"
+
 
 # Any overrides on the parset
 COBALT_PARSET_OVERRIDES = """
@@ -51,4 +52,4 @@ PIC.Core.Cobalt.cbt206_1.out_nic=[]
 COBALT_PARSET_FILENAME_PATTERN = "CorrProc_{subtask_id}.param"
 
 # Script to start observations on COBALT_HEADNODE
-COBALT_STARTBGL_SCRIPT = "source /home/mol/build/gnucxx11_2018_opt/installed/lofarinit.sh && LOFARENV=PRODUCTION /home/mol/build/gnucxx11_2018_opt/installed/bin/startBGL.sh"
+COBALT_STARTBGL_SCRIPT_TEMPLATE = "source /opt/lofar-versions/%(cobalt_release)s/lofarinit.sh && LOFARENV=PRODUCTION /opt/lofar-versions/%(cobalt_release)s/bin/runObservation.sh"
\ No newline at end of file
diff --git a/SAS/TMSS/backend/services/lobster/lib/message_handler.py b/SAS/TMSS/backend/services/lobster/lib/message_handler.py
index 17d372c552c..80de279313c 100644
--- a/SAS/TMSS/backend/services/lobster/lib/message_handler.py
+++ b/SAS/TMSS/backend/services/lobster/lib/message_handler.py
@@ -28,9 +28,9 @@ from lofar.sas.tmss.services.lobster.specification_translation import extract_st
 
 from .config import (
     COBALT_HEADNODE,
-    COBALT_PARSET_DIR,
+    COBALT_PARSET_DIR_TEMPLATE,
     COBALT_PARSET_OVERRIDES,
-    COBALT_STARTBGL_SCRIPT,
+    COBALT_STARTBGL_SCRIPT_TEMPLATE,
     COBALT_PARSET_FILENAME_PATTERN,
 )
 
@@ -146,6 +146,9 @@ class L2TMSSObservationControlMessageHandler(TMSSEventMessageHandler):
 
     def _enqueue_observation_on_COBALT(self, subtask: dict):
         subtask_id = subtask['id']
+        cobalt_release = subtask['specifications_doc'].get('COBALT', {}).get('release', 'current')
+        COBALT_PARSET_DIR = COBALT_PARSET_DIR_TEMPLATE % {'cobalt_release': cobalt_release}
+        COBALT_STARTBGL_SCRIPT = COBALT_STARTBGL_SCRIPT_TEMPLATE % {'cobalt_release': cobalt_release}
 
         # COBALT expects the parset to be on the disk of its head node, and
         # then for a script to kickstart the observation process. COBALT
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py
index 48d66469615..6335456784f 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py
@@ -495,7 +495,7 @@ def _convert_to_parset_dict_for_observationcontrol_schema(subtask: models.Subtas
         parset[prefix+"ObservationControl.OnlineControl.CorrAppl.CorrProc._hostname"] = "cbmmaster"
         parset[prefix+"ObservationControl.OnlineControl.CorrAppl.CorrProc._nodes"] = []
         parset[prefix+"ObservationControl.OnlineControl.CorrAppl.CorrProc._startstopType"] = "bgl"  # note: this is three correlators ago, and hopefully we get rid of it in LOFAR 2.0 ;)
-        parset[prefix+"ObservationControl.OnlineControl.CorrAppl.CorrProc.workingdir"] = "/opt/lofar/bin/"
+        parset[prefix+"ObservationControl.OnlineControl.CorrAppl.CorrProc.workingdir"] = f"/opt/lofar-versions/{spec['COBALT']['release']}/bin"
         parset[prefix+"ObservationControl.OnlineControl.CorrAppl._hostname"] = "cbmmaster"
         parset[prefix+"ObservationControl.OnlineControl.CorrAppl.extraInfo"] = '["PIC","Cobalt"]'
         parset[prefix+"ObservationControl.OnlineControl.CorrAppl.procesOrder"] = []    # note: typo is correct ;)
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/correlator-9.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/correlator-9.json
new file mode 100644
index 00000000000..f368a41acec
--- /dev/null
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/correlator-9.json
@@ -0,0 +1,72 @@
+{
+  "description": "This schema provides a definitions for the LOFAR correlator.",
+  "name": "correlator",
+  "purpose": "technical_commissioning",
+  "schema": {
+    "$id": "https://tmss.lofar.eu/api/schemas/commonschematemplate/correlator/8#",
+    "$schema": "http://json-schema.org/draft-06/schema#",
+    "additionalProperties": false,
+    "definitions": {
+      "correlator": {
+        "additionalProperties": false,
+        "default": {},
+        "properties": {
+          "channels_per_subband": {
+            "default": 64,
+            "description": "Number of frequency bands per subband",
+            "enum": [
+              8,
+              16,
+              32,
+              64,
+              128,
+              256,
+              512,
+              1024
+            ],
+            "minimum": 8,
+            "title": "Channels/subband",
+            "type": "integer"
+          },
+          "integration_time": {
+            "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/datetime/9#/definitions/timedelta",
+            "default": 1,
+            "description": "Desired integration period (seconds)",
+            "minimum": 0.1,
+            "title": "Integration time"
+          },
+          "storage_cluster": {
+            "default": "CEP4",
+            "description": "Cluster to write output to",
+            "enum": [
+              "CEP4",
+              "DragNet"
+            ],
+            "title": "Storage cluster",
+            "type": "string"
+          },
+          "topocentric_frequency_correction": {
+            "default": false,
+            "description": "Correct frequencies for the Doppler shift caused by the Earth's rotation.",
+            "title": "Topocentric Frequency Correction",
+            "type": "boolean"
+          },
+          "release": {
+            "default": "current",
+            "description": "The version identifier for the COBALT release to use.",
+            "title": "Cobalt release version",
+            "type": "string"
+          }
+        }
+      }
+    },
+    "description": "This schema provides a definitions for the LOFAR correlator.",
+    "patternProperties": {
+      "^[$]schema$": {}
+    },
+    "title": "correlator",
+    "version": 9
+  },
+  "state": "active",
+  "version": 9
+}
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-12.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-12.json
new file mode 100644
index 00000000000..132f85bffb1
--- /dev/null
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-12.json
@@ -0,0 +1,575 @@
+{
+  "description": "This schema defines the parameters to setup and control the observation subtask.",
+  "name": "observation control",
+  "purpose": "technical_commissioning",
+  "schema": {
+    "$id": "https://tmss.lofar.eu/api/schemas/subtasktemplate/observation%20control/11#",
+    "$schema": "http://json-schema.org/draft-06/schema#",
+    "additionalProperties": false,
+    "default": {},
+    "description": "This schema defines the parameters to setup and control the observation subtask.",
+    "patternProperties": {
+      "^[$]schema$": {}
+    },
+    "properties": {
+      "COBALT": {
+        "additionalProperties": false,
+        "default": {},
+        "properties": {
+          "bandpass_correction": {
+            "default": true,
+            "description": "Compensate for differences in station sensitivity within a subband",
+            "title": "Apply band-pass correction",
+            "type": "boolean"
+          },
+          "beamformer": {
+            "additionalProperties": false,
+            "default": {},
+            "properties": {
+              "flyseye_pipelines": {
+                "additionalItems": false,
+                "default": [],
+                "items": {
+                  "additionalProperties": false,
+                  "headerTemplate": "Pipeline {{ self.index }}",
+                  "properties": {
+                    "coherent": {
+                      "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/beamforming/9#/definitions/stokes_settings",
+                      "default": {},
+                      "title": "Coherent Stokes Settings"
+                    },
+                    "stations": {
+                      "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/stations/9/#/definitions/station_list",
+                      "default": [],
+                      "description": "Stations to (flys eye) beam form. This can be a subset of the obervation stations."
+                    }
+                  },
+                  "required": [
+                    "coherent",
+                    "stations"
+                  ],
+                  "title": "Fly's Eye Pipeline",
+                  "type": "object"
+                },
+                "minItems": 0,
+                "title": "Pipelines",
+                "type": "array"
+              },
+              "input_ppf": {
+                "default": false,
+                "description": "Use a PPF/inverse PPF for channellisation during beamforming, instead of an FFT.",
+                "title": "Use a PPF when beamforming, not an FFT",
+                "type": "boolean"
+              },
+              "tab_pipelines": {
+                "additionalItems": false,
+                "default": [],
+                "items": {
+                  "additionalProperties": false,
+                  "default": {},
+                  "headerTemplate": "Pipeline {{ self.index }}",
+                  "properties": {
+                    "SAPs": {
+                      "additionalItems": false,
+                      "default": [],
+                      "items": {
+                        "additionalProperties": false,
+                        "properties": {
+                          "name": {
+                            "description": "Name of SAP in which to form TABs",
+                            "title": "SAP name",
+                            "type": "string"
+                          },
+                          "subbands": {
+                            "additionalItems": false,
+                            "default": [],
+                            "description": "Subbands to beam form. Leave empty to beam form all subbands of the SAP.",
+                            "items": {
+                              "maxLength": 488,
+                              "maximum": 511,
+                              "minLength": 1,
+                              "minimum": 0,
+                              "title": "Subband",
+                              "type": "integer"
+                            },
+                            "title": "Subband list",
+                            "type": "array"
+                          },
+                          "tabs": {
+                            "additionalItems": false,
+                            "default": [],
+                            "description": "Tied-array beams to form",
+                            "items": {
+                              "additonalProperties": false,
+                              "default": {},
+                              "headerTemplate": "TAB {{ self.index }}",
+                              "properties": {
+                                "coherent": {
+                                  "default": true,
+                                  "description": "Tied-array beam is coherent",
+                                  "title": "Coherent",
+                                  "type": "boolean"
+                                },
+                                "pointings": {
+                                  "additionalItems": false,
+                                  "items": {
+                                    "additionalProperties": false,
+                                    "properties": {
+                                      "duration": {
+                                        "default": 0,
+                                        "description": "Duration of this pointing. 0 = observation duration",
+                                        "minimum": 0,
+                                        "title": "Duration",
+                                        "type": "integer"
+                                      },
+                                      "pointing": {
+                                        "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/pointing/8/#/definitions/pointing",
+                                        "description": "Pointing for coherent beam",
+                                        "title": "Pointing"
+                                      }
+                                    },
+                                    "required": [
+                                      "pointing"
+                                    ],
+                                    "title": "Pointing",
+                                    "type": "object"
+                                  },
+                                  "maxItems": 1,
+                                  "minItems": 0,
+                                  "title": "Consecutive pointings",
+                                  "type": "array"
+                                }
+                              },
+                              "required": [
+                                "coherent"
+                              ],
+                              "title": "Tied-Array Beam"
+                            },
+                            "title": "Tied-Array Beams",
+                            "type": "array"
+                          }
+                        },
+                        "required": [
+                          "name",
+                          "tabs"
+                        ],
+                        "title": "SAP",
+                        "type": "object"
+                      },
+                      "minItems": 1,
+                      "title": "SAPs",
+                      "type": "array"
+                    },
+                    "coherent": {
+                      "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/beamforming/9#/definitions/stokes_settings",
+                      "title": "Coherent Stokes Settings"
+                    },
+                    "incoherent": {
+                      "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/beamforming/9#/definitions/stokes_settings",
+                      "title": "Incoherent Stokes Settings"
+                    },
+                    "stations": {
+                      "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/stations/9/#/definitions/station_list",
+                      "default": [],
+                      "description": "Stations to beam form. This can be a subset of the obervation stations.",
+                      "minItems": 0
+                    }
+                  },
+                  "required": [
+                    "SAPs",
+                    "stations"
+                  ],
+                  "title": "Pipeline",
+                  "type": "object"
+                },
+                "minItems": 0,
+                "title": "Tied-array Beam-former Pipeline",
+                "type": "array"
+              }
+            },
+            "title": "Beamformer",
+            "type": "object"
+          },
+          "blocksize": {
+            "default": 196608,
+            "description": "Size of blocks COBALT works on, must be a multiple of all processing requirements",
+            "maximum": 292968,
+            "minimum": 97656,
+            "title": "Block size (samples)",
+            "type": "integer"
+          },
+          "correlator": {
+            "additonalProperties": false,
+            "properties": {
+              "blocks_per_integration": {
+                "default": 1,
+                "description": "Number of blocks to integrate",
+                "minimum": 1,
+                "title": "Blocks per integration",
+                "type": "integer"
+              },
+              "channels_per_subband": {
+                "default": 64,
+                "description": "Number of frequency bands per subband",
+                "enum": [
+                  1,
+                  8,
+                  16,
+                  32,
+                  64,
+                  128,
+                  256,
+                  512,
+                  1024
+                ],
+                "minimum": 1,
+                "title": "Channels/subband",
+                "type": "integer"
+              },
+              "doppler_correction": {
+                "default": false,
+                "description": "Correct frequencies for the Doppler shift caused by the Earth's rotation.",
+                "title": "Doppler Correction",
+                "type": "boolean"
+              },
+              "enabled": {
+                "default": true,
+                "title": "Enable Correlator",
+                "type": "boolean"
+              },
+              "integrations_per_block": {
+                "default": 1,
+                "description": "Number of integrations to fit within each block",
+                "minimum": 1,
+                "title": "Integrations per block",
+                "type": "integer"
+              }
+            },
+            "required": [
+              "enabled"
+            ],
+            "title": "Correlator Settings",
+            "type": "object"
+          },
+          "debug": {
+            "additionalProperties": false,
+            "description": "Settings for debug & performance analysis",
+            "properties": {
+              "annotate_broken_antennas": {
+                "default": true,
+                "description": "Annotate dataproducts with which antennas were broken.",
+                "title": "Fetch broken antenna information",
+                "type": "boolean"
+              },
+              "benchmark_file": {
+                "default": "",
+                "description": "Path to CSV file to write benchmark information to.",
+                "title": "Benchmark filename",
+                "type": "string"
+              },
+              "write_output": {
+                "default": true,
+                "description": "If disabled, no data are actually written to disk.",
+                "title": "Write output",
+                "type": "boolean"
+              }
+            },
+            "title": "Debug settings",
+            "type": "object"
+          },
+          "delay_compensation": {
+            "default": true,
+            "description": "Compensate for geometric and clock differences",
+            "title": "Apply delay compensation",
+            "type": "boolean"
+          },
+          "resources": {
+            "additionalProperties": false,
+            "description": "System resources COBALT should use",
+            "properties": {
+              "processing_nodes": {
+                "additionalItems": false,
+                "default": [
+                  "cbt201_0",
+                  "cbt201_1",
+                  "cbt202_0",
+                  "cbt202_1",
+                  "cbt203_0",
+                  "cbt203_1",
+                  "cbt204_0",
+                  "cbt204_1",
+                  "cbt205_0",
+                  "cbt205_1",
+                  "cbt207_0",
+                  "cbt207_1",
+                  "cbt208_0",
+                  "cbt208_1",
+                  "cbt209_0",
+                  "cbt209_1",
+                  "cbt210_0",
+                  "cbt210_1",
+                  "cbt211_0",
+                  "cbt211_1",
+                  "cbt212_0",
+                  "cbt212_1"
+                ],
+                "items": {
+                  "enum": [
+                    "cbt201_0",
+                    "cbt201_1",
+                    "cbt202_0",
+                    "cbt202_1",
+                    "cbt203_0",
+                    "cbt203_1",
+                    "cbt204_0",
+                    "cbt204_1",
+                    "cbt205_0",
+                    "cbt205_1",
+                    "cbt206_0",
+                    "cbt206_1",
+                    "cbt207_0",
+                    "cbt207_1",
+                    "cbt208_0",
+                    "cbt208_1",
+                    "cbt209_0",
+                    "cbt209_1",
+                    "cbt210_0",
+                    "cbt210_1",
+                    "cbt211_0",
+                    "cbt211_1",
+                    "cbt212_0",
+                    "cbt212_1",
+                    "cbt213_0",
+                    "cbt213_1",
+                    "drg01",
+                    "drg02",
+                    "drg03",
+                    "drg04",
+                    "drg05",
+                    "drg06",
+                    "drg07",
+                    "drg08",
+                    "drg09",
+                    "drg10",
+                    "drg11",
+                    "drg12",
+                    "drg13",
+                    "drg14",
+                    "drg15",
+                    "drg16",
+                    "drg17",
+                    "drg18",
+                    "drg19",
+                    "drg20",
+                    "drg21",
+                    "drg22",
+                    "drg23"
+                  ],
+                  "title": "Node",
+                  "type": "string"
+                },
+                "minItems": 1,
+                "title": "Processing nodes",
+                "type": "array",
+                "uniqueItems": true
+              },
+              "writer_nodes": {
+                "additionalItems": false,
+                "default": [
+                  "cpu01.cep4.infiniband.lofar",
+                  "cpu02.cep4.infiniband.lofar",
+                  "cpu03.cep4.infiniband.lofar",
+                  "cpu04.cep4.infiniband.lofar",
+                  "cpu05.cep4.infiniband.lofar"
+                ],
+                "items": {
+                  "enum": [
+                    "cpu01.cep4.infiniband.lofar",
+                    "cpu02.cep4.infiniband.lofar",
+                    "cpu03.cep4.infiniband.lofar",
+                    "cpu04.cep4.infiniband.lofar",
+                    "cpu05.cep4.infiniband.lofar",
+                    "cpu06.cep4.infiniband.lofar",
+                    "cpu07.cep4.infiniband.lofar",
+                    "cpu08.cep4.infiniband.lofar",
+                    "cpu09.cep4.infiniband.lofar",
+                    "cpu10.cep4.infiniband.lofar",
+                    "cpu11.cep4.infiniband.lofar",
+                    "cpu12.cep4.infiniband.lofar",
+                    "cpu13.cep4.infiniband.lofar",
+                    "cpu14.cep4.infiniband.lofar",
+                    "cpu15.cep4.infiniband.lofar",
+                    "cpu16.cep4.infiniband.lofar",
+                    "cpu17.cep4.infiniband.lofar",
+                    "cpu18.cep4.infiniband.lofar",
+                    "cpu19.cep4.infiniband.lofar",
+                    "cpu20.cep4.infiniband.lofar",
+                    "cpu21.cep4.infiniband.lofar",
+                    "cpu22.cep4.infiniband.lofar",
+                    "cpu23.cep4.infiniband.lofar",
+                    "cpu24.cep4.infiniband.lofar",
+                    "cpu25.cep4.infiniband.lofar",
+                    "cpu26.cep4.infiniband.lofar",
+                    "cpu27.cep4.infiniband.lofar",
+                    "cpu28.cep4.infiniband.lofar",
+                    "cpu29.cep4.infiniband.lofar",
+                    "cpu30.cep4.infiniband.lofar",
+                    "cpu31.cep4.infiniband.lofar",
+                    "cpu32.cep4.infiniband.lofar",
+                    "cpu33.cep4.infiniband.lofar",
+                    "cpu34.cep4.infiniband.lofar",
+                    "cpu35.cep4.infiniband.lofar",
+                    "cpu36.cep4.infiniband.lofar",
+                    "cpu37.cep4.infiniband.lofar",
+                    "cpu38.cep4.infiniband.lofar",
+                    "cpu39.cep4.infiniband.lofar",
+                    "cpu40.cep4.infiniband.lofar",
+                    "cpu41.cep4.infiniband.lofar",
+                    "cpu42.cep4.infiniband.lofar",
+                    "cpu43.cep4.infiniband.lofar",
+                    "cpu44.cep4.infiniband.lofar",
+                    "cpu45.cep4.infiniband.lofar",
+                    "cpu46.cep4.infiniband.lofar",
+                    "cpu47.cep4.infiniband.lofar",
+                    "cpu48.cep4.infiniband.lofar",
+                    "cpu49.cep4.infiniband.lofar",
+                    "cpu50.cep4.infiniband.lofar"
+                  ],
+                  "title": "Node",
+                  "type": "string"
+                },
+                "minItems": 1,
+                "title": "Output writer nodes",
+                "type": "array",
+                "uniqueItems": true
+              }
+            },
+            "title": "System resources",
+            "type": "object"
+          },
+          "version": {
+            "default": 1,
+            "description": "Version of the COBALT specification to emit",
+            "maximum": 2,
+            "minimum": 1,
+            "title": "Specification version",
+            "type": "integer"
+          },
+          "release": {
+            "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/correlator/9#/definitions/release",
+            "default": "current"
+          }
+        },
+        "required": [
+          "blocksize"
+        ],
+        "title": "COBALT correlator/beamformer",
+        "type": "object"
+      },
+      "QA": {
+        "additonalProperties": false,
+        "default": {},
+        "properties": {
+          "inspection_plots": {
+            "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/QA/8#/definitions/inspection_plots",
+            "default": "msplots"
+          }
+        },
+        "title": "QA Settings",
+        "type": "object"
+      },
+      "stations": {
+        "additionalProperties": false,
+        "default": {},
+        "properties": {
+          "analog_pointing": {
+            "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/pointing/8/#/definitions/pointing",
+            "default": {},
+            "description": "HBA only",
+            "title": "Analog pointing"
+          },
+          "antenna_set": {
+            "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/stations/9/#/definitions/antenna_set",
+            "default": "HBA_DUAL"
+          },
+          "digital_pointings": {
+            "additionalItems": false,
+            "default": [
+              {}
+            ],
+            "items": {
+              "additionalProperties": false,
+              "headerTemplate": "{{ i0 }} - {{ self.name }}",
+              "properties": {
+                "name": {
+                  "default": "_SAP_name_",
+                  "description": "Custom identifier for this beam. Same name is same beam.",
+                  "minLength": 1,
+                  "title": "Name",
+                  "type": "string"
+                },
+                "pointing": {
+                  "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/pointing/8/#/definitions/pointing",
+                  "default": {},
+                  "title": "Digital pointing"
+                },
+                "purpose": {
+                  "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/pointing/8/#/definitions/purpose",
+                  "default": "target"
+                },
+                "subbands": {
+                  "additionalItems": false,
+                  "default": [],
+                  "items": {
+                    "maxLength": 488,
+                    "maximum": 511,
+                    "minLength": 1,
+                    "minimum": 0,
+                    "title": "Subband",
+                    "type": "integer"
+                  },
+                  "title": "Subband list",
+                  "type": "array"
+                }
+              },
+              "required": [
+                "name",
+                "pointing",
+                "subbands"
+              ],
+              "title": "Beam",
+              "type": "object"
+            },
+            "title": "Beams",
+            "type": "array"
+          },
+          "filter": {
+            "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/stations/9/#/definitions/filter",
+            "default": "HBA_110_190"
+          },
+          "station_list": {
+            "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/stations/9/#/definitions/station_list",
+            "default": [
+              "CS001"
+            ]
+          }
+        },
+        "required": [
+          "station_list",
+          "digital_pointings"
+        ],
+        "type": "object"
+      }
+    },
+    "required": [
+      "stations",
+      "COBALT",
+      "QA"
+    ],
+    "title": "observation control",
+    "type": "object",
+    "version": 12
+  },
+  "state": "active",
+  "version": 12
+}
-- 
GitLab