From 4209b36ab5e1a74759da96701b645d320fa5d01b Mon Sep 17 00:00:00 2001 From: PyxieLouStar Date: Thu, 25 Jan 2024 19:32:33 +0000 Subject: [PATCH] add filtering for center packet loss --- SSINS/data/MWA_EoR_Highband_shape_dict.yml | 3 +++ SSINS/match_filter.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/SSINS/data/MWA_EoR_Highband_shape_dict.yml b/SSINS/data/MWA_EoR_Highband_shape_dict.yml index d648e3b..d985251 100644 --- a/SSINS/data/MWA_EoR_Highband_shape_dict.yml +++ b/SSINS/data/MWA_EoR_Highband_shape_dict.yml @@ -10,3 +10,6 @@ TV8: TV9: - 195000000.0 - 202000000.0 +center_packet_loss: +- 177000000.0 +- 187000000.0 diff --git a/SSINS/match_filter.py b/SSINS/match_filter.py index b54fedf..5f32653 100644 --- a/SSINS/match_filter.py +++ b/SSINS/match_filter.py @@ -143,6 +143,22 @@ def match_test(self, INS): sig = np.absolute(INS.metric_ms[t, f, p]) t = slice(t, t + 1) f = slice(f, f + 1) + elif shape == 'center_packet_loss': + N = np.count_nonzero(np.logical_not(INS.metric_ms[:, self.slice_dict[shape]].mask), + axis=1) + sliced_arr = (INS.metric_ms[:, self.slice_dict[shape]].mean(axis=1)) * np.sqrt(N) + t, p = np.unravel_index((sliced_arr / self.sig_thresh[shape]).argmin(), + sliced_arr.shape) + t = slice(t, t + 1) + f = self.slice_dict[shape] + # Pull out the number instead of a sliced arr + sig = sliced_arr[t, p][0] + if sig < 0: + print('found packet loss') + print(sig) + sig = np.absolute(sig) + else: + continue else: N = np.count_nonzero(np.logical_not(INS.metric_ms[:, self.slice_dict[shape]].mask), axis=1)