From 40462a8e34fc719c49d275e455b4712b678b75d2 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Mon, 26 Feb 2024 14:07:35 +0100
Subject: [PATCH] L2SS-1511: only address the lofar2 stations via lobster

---
 SAS/TMSS/backend/src/tmss/tmssapp/adapters/l2stationspecs.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/l2stationspecs.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/l2stationspecs.py
index 81097493f46..a999598d78e 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/l2stationspecs.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/l2stationspecs.py
@@ -20,6 +20,7 @@ import copy
 
 from lofar.sas.tmss.tmss.tmssapp import models
 from lofar.common.json_utils import validate_json_against_schema
+from lofar.sas.tmss.tmss.tmssapp.conversions import get_lofar2_stations
 
 import logging
 logger = logging.getLogger(__name__)
@@ -71,8 +72,9 @@ def convert_to_l2stationspecs_dict(subtask: models.Subtask) -> dict:
 
     # get the template with the json schema to check validity of the l2stationspecs
     l2station_template = models.CommonSchemaTemplate.get_latest("lofar2station")
+    specified_lofar2_stations = set(subtask.specifications_doc["stations"]["station_list"]).intersection(set(get_lofar2_stations()))
 
-    for station in subtask.specifications_doc["stations"]["station_list"]:  # todo: I guess we would simply filter for lofar2-stations here (L2SS-1189)?
+    for station in specified_lofar2_stations:  
         antenna_set = subtask.specifications_doc["stations"]["antenna_set"]
         station_type = station_to_type(station)
 
-- 
GitLab