From f2d3547b57ac93e9910cd0ee145c94d2cdfbcc94 Mon Sep 17 00:00:00 2001
From: jurjen93 <jurjendejong93@gmail.com>
Date: Wed, 4 Dec 2024 13:30:39 +0100
Subject: [PATCH] t

---
 h5_merger.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/h5_merger.py b/h5_merger.py
index ecb960b..80a070a 100644
--- a/h5_merger.py
+++ b/h5_merger.py
@@ -1684,12 +1684,11 @@ def add_ms_antennas(self, keep_h5_interstations=None):
                                 ms_values[get_slices(ms_values, idx, antenna_index)] += h5_values[get_slices(h5_values, idx_h5, antenna_index)]
                             elif 'CS' in antenna and superstation:  # core stations
                                 ms_values[get_slices(ms_values, idx, antenna_index)] += h5_values[get_slices(h5_values, superstation_index, antenna_index)]
-                            elif antenna not in h5_antlist and ('amplitude' in soltab or axes == 'weight') \
-                                    and 'RS' not in antenna and 'CS' not in antenna:
+                            elif antenna not in h5_antlist and ('amplitude' in soltab or axes == 'weight'):
                                 if axes == 'val':
                                     print('Add ' + antenna + ' to output H5 from MS')
                                 ms_values[get_slices(ms_values, idx, antenna_index)] = 1
-                                if pol_index is not None and axes != 'weight':
+                                if pol_index is not None and axes != 'weight' and shape[pol_index]==4:
                                     ms_values[get_double_slice(ms_values, [idx, 1], [antenna_index, pol_index])] = 0
                                     ms_values[get_double_slice(ms_values, [idx, 2], [antenna_index, pol_index])] = 0