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

Source flags update #1079

Merged
merged 8 commits into from
Jan 6, 2025
Merged

Source flags update #1079

merged 8 commits into from
Jan 6, 2025

Conversation

mmccrackan
Copy link
Contributor

Updates SourceFlags preprocess functions. Adds a check to see if the input source is nearby and does the flagging as before. Returns a zero RangeMatrix if no source is found. Now, it accepts a list of sources and loops through them which are wrapped into proc_aman.source_flags.source_name. Currently requires FocalplaneNanFlags to be run first so that any focal plane NaNs are removed.

@mmccrackan mmccrackan marked this pull request as ready for review January 3, 2025 20:41
@mmccrackan mmccrackan requested a review from msilvafe January 3, 2025 20:45
Copy link
Contributor

@msilvafe msilvafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple inline comments to address but approved.

calc:
mask: {'shape': 'circle',
'xyr': (0, 0, 1.)}
'xyr': [0, 0, 1.]}
center_on: 'jupiter'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe give an example of passing a list or add a comment i.e. # str or list of str actually as is if this isn't a list this will fail right since you're looping over center_on_list = calc_cfgs.get('center_on', 'planet') perhaps you need an np.atleast1d() to resolve that.

Comment on lines 1044 to 1050
if center_on == 'planet':
from sotodlib.coords.planets import SOURCE_LIST
matches = [x for x in aman.tags if x in SOURCE_LIST]
if len(matches) != 0:
source = matches[0]
else:
raise ValueError("No tags match source list")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't give you a list, it'll always just pick out the first match. I think you want to delete this for loop and to have this check right after calc_cfgs.get('center_on', 'planet') then what's called matches here can be source_list and you don't need center_on_list at all you just need source_list. Also I don't think center_on can ever be planet (L1044) as its a string so when you try to iterate over it it'll fail (addressed via my previous comment) on L1027.

@mmccrackan mmccrackan merged commit 94882fb into master Jan 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants