From aa22a2152acded5ea489f348a8d9d14d8946be41 Mon Sep 17 00:00:00 2001 From: susannaaz Date: Wed, 18 Dec 2024 15:59:52 -0500 Subject: [PATCH] azss tested with bad subscans flags included --- sotodlib/mapmaking/demod_mapmaker.py | 2 +- sotodlib/preprocess/processes.py | 6 +++--- sotodlib/tod_ops/azss.py | 6 ++++-- sotodlib/tod_ops/flags.py | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sotodlib/mapmaking/demod_mapmaker.py b/sotodlib/mapmaking/demod_mapmaker.py index 8b13d9152..0eebc7d61 100644 --- a/sotodlib/mapmaking/demod_mapmaker.py +++ b/sotodlib/mapmaking/demod_mapmaker.py @@ -527,7 +527,7 @@ def make_demod_map(context, obslist, noise_model, info, overwrite=False) errors.append(error) ; outputs.append((output_init, output_proc)) ; if error not in [None,'load_success']: - L.info('tod %s:%s:%s failed in the prepoc database'%(obs_id,detset,band)) + L.info('tod %s:%s:%s failed in the preproc database'%(obs_id,detset,band)) continue obs.wrap("weather", np.full(1, "toco")) obs.wrap("site", np.full(1, site)) diff --git a/sotodlib/preprocess/processes.py b/sotodlib/preprocess/processes.py index 2c2052c97..a4a779ca3 100644 --- a/sotodlib/preprocess/processes.py +++ b/sotodlib/preprocess/processes.py @@ -1695,9 +1695,9 @@ def calc_and_save(self, aman, proc_aman): subscan_stats_Q = subscan_stats_Q, subscan_stats_U = subscan_stats_U, **self.calc_cfgs) ss_aman = core.AxisManager(aman.dets, aman.samps) - ss_aman.wrap("noisy_subscan", msk_ss, [(0, 'dets'), (1, 'samps')]) + ss_aman.wrap("valid_subscan", ~msk_ss, [(0, 'dets'), (1, 'samps')]) det_aman = core.AxisManager(aman.dets) - det_aman.wrap("noisy_dets", msk_det) + det_aman.wrap("valid_dets", ~msk_det) self.save(proc_aman, ss_aman, "noisy_subscan_flags") self.save(proc_aman, det_aman, "noisy_dets_flags") @@ -1712,7 +1712,7 @@ def select(self, meta, proc_aman=None): return meta if proc_aman is None: proc_aman = meta.preprocess - meta.restrict('dets', proc_aman.dets.vals[~proc_aman.noisy_dets_flags.noisy_dets]) + meta.restrict('dets', proc_aman.dets.vals[proc_aman.noisy_dets_flags.valid_dets]) return meta _Preprocess.register(SplitFlags) diff --git a/sotodlib/tod_ops/azss.py b/sotodlib/tod_ops/azss.py index 0cb5667d1..5ea09de01 100644 --- a/sotodlib/tod_ops/azss.py +++ b/sotodlib/tod_ops/azss.py @@ -234,7 +234,7 @@ def get_azss(aman, signal='signal', az=None, frange=None, bins=100, flags=None, left_right: bool Default False. If True estimate (and subtract) the AzSS template for left and right subscans separately. - turnaround_flags: FlagManager or AxisManager + turnaround_info: FlagManager or AxisManager Optional, default is aman.flags. Returns @@ -273,7 +273,7 @@ def get_azss(aman, signal='signal', az=None, frange=None, bins=100, flags=None, if flags is None: flags = Ranges.from_mask(np.zeros(aman.samps.count).astype(bool)) - + if left_right: if turnaround_info is None: turnaround_info = aman.flags @@ -287,6 +287,8 @@ def get_azss(aman, signal='signal', az=None, frange=None, bins=100, flags=None, left_mask = turnaround_info.left_scan right_mask = turnaround_info.right_scan else: + print("") + print("HEREEEEEEE") left_mask = turnaround_info.valid_left_scans right_mask = turnaround_info.valid_right_scans diff --git a/sotodlib/tod_ops/flags.py b/sotodlib/tod_ops/flags.py index bd35112b6..6ea917778 100644 --- a/sotodlib/tod_ops/flags.py +++ b/sotodlib/tod_ops/flags.py @@ -1090,4 +1090,4 @@ def get_noisy_subscan_flags(aman, subscan_stats_T, subscan_stats_Q, subscan_stat raise ValueError(f"Flag name {name} already exists in aman.flags") aman.flags.wrap(name, noisy_subscan_flags) - return noisy_subscan_flags, noisy_detector_flags + return noisy_subscan_flags, noisy_detector_flags \ No newline at end of file