Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Source Flags #1090

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions sotodlib/preprocess/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,18 @@ def select(self, meta, proc_aman=None):
else:
source_flags = proc_aman.source_flags

for source in source_flags._fields:
keep = ~has_all_cut(source_flags[source])
meta.restrict("dets", meta.dets.vals[keep])
source_flags.restrict("dets", source_flags.dets.vals[keep])
source_list = np.atleast_1d(self.calc_cfgs.get('center_on', 'planet'))
if source_list == ['planet']:
from sotodlib.coords.planets import SOURCE_LIST
source_list = [x for x in aman.tags if x in SOURCE_LIST]
if len(source_list) == 0:
raise ValueError("No tags match source list")

for source in source_list:
if source in source_flags._fields:
keep = ~has_all_cut(source_flags[source])
meta.restrict("dets", meta.dets.vals[keep])
source_flags.restrict("dets", source_flags.dets.vals[keep])
return meta

class HWPAngleModel(_Preprocess):
Expand Down
Loading