From 9040a9a16ea4885eed01d13c0c2099d63d6d9417 Mon Sep 17 00:00:00 2001
From: Matthijs van der Wild <matthijs.van-der-wild@durham.ac.uk>
Date: Tue, 27 Feb 2024 11:43:48 +0000
Subject: [PATCH] Bugfix prep delay

---
 scripts/TargetListToCoords.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/TargetListToCoords.py b/scripts/TargetListToCoords.py
index 34a37c54..115e566a 100644
--- a/scripts/TargetListToCoords.py
+++ b/scripts/TargetListToCoords.py
@@ -30,13 +30,11 @@ def plugin_main(**kwargs):
     if mode == 'delay_calibration':
         RA_val = [RA_val[0]]
         DEC_val = [DEC_val[0]]
-        Source_id = Source_id[:1]
-        if str(Source_id[0])[0:1] == 'I':
-            pass
-        elif str(Source_id[0])[0:1] == 'S':
+        Source_id = Source_id[0]
+        if isinstance(Source_id, str):
             pass
         else:
-            Source_id = ['S' + str(x) for x in Source_id[0]]
+            Source_id = ['S' + str(Source_id)]
 
     # make a string of coordinates for the DP3 command
     ss = [ '[' + str(x) + 'deg,' + str(y) + 'deg]' for x, y in zip(RA_val, DEC_val) ]
@@ -49,6 +47,4 @@ def plugin_main(**kwargs):
                         + " \"delay_calibration\", \"split_directions\""
                         + f" but was {mode}.")
 
-    result = {'name' : ",".join(Source_id),
-              'coords' : ss}
-    return result
+    return {'name' : ",".join(Source_id), 'coords' : ss}
-- 
GitLab