-
Notifications
You must be signed in to change notification settings - Fork 19
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
Source flags update #1079
Conversation
There was a problem hiding this 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.
sotodlib/preprocess/processes.py
Outdated
calc: | ||
mask: {'shape': 'circle', | ||
'xyr': (0, 0, 1.)} | ||
'xyr': [0, 0, 1.]} | ||
center_on: 'jupiter' |
There was a problem hiding this comment.
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.
sotodlib/preprocess/processes.py
Outdated
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") |
There was a problem hiding this comment.
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.
Updates
SourceFlags
preprocess functions. Adds a check to see if the input source is nearby and does the flagging as before. Returns a zeroRangeMatrix
if no source is found. Now, it accepts a list of sources and loops through them which are wrapped intoproc_aman.source_flags.source_name
. Currently requiresFocalplaneNanFlags
to be run first so that any focal planeNaNs
are removed.