From 927d59916cff5990a63540e71f66ce8ed4848602 Mon Sep 17 00:00:00 2001 From: John Tobin Date: Mon, 21 Oct 2024 14:01:45 -0400 Subject: [PATCH] add support for new cont.dat format --- selfcal_helpers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/selfcal_helpers.py b/selfcal_helpers.py index 906a641..75fa51c 100644 --- a/selfcal_helpers.py +++ b/selfcal_helpers.py @@ -1397,7 +1397,14 @@ def parse_contdotdat(contdotdat_file,target): continue if desiredTarget==True: if 'SpectralWindow' in line: - spw = int(line.split()[-1]) + #code to adapt to new cont.dat format + splitline=line.split() + if len(splitline)==3: + spw = int(splitline[-2]) + spwname=splitline[-1] + else: + spw = int(splitline[-1]) + spwname='' contdotdat[spw] = [] else: contdotdat[spw] += [line.split()[0].split("G")[0].split("~")]