Skip to content

Commit

Permalink
azss tested with bad subscans flags included
Browse files Browse the repository at this point in the history
  • Loading branch information
susannaaz committed Dec 18, 2024
1 parent 9a3b564 commit aa22a21
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sotodlib/mapmaking/demod_mapmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions sotodlib/preprocess/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions sotodlib/tod_ops/azss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sotodlib/tod_ops/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aa22a21

Please sign in to comment.