-
Notifications
You must be signed in to change notification settings - Fork 3
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
192 q6 data selection based flagging #396
Conversation
oops looks like I broke something else. let me fix it before you review |
ok, it was skeleton code for channel flags that is not really formulated yet |
Flagging using all of the columns is not possible. For example: sdfits.flag(subobsmode="TPWCAL") results in ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[7], line 1
----> 1 sdfits.flag(subobsmode="TPWCAL")
File [/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/log.py:360](http://thales.gb.nrao.edu:9035/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/log.py#line=359), in log_call_to_history.<locals>.wrapper(self, *args, **kwargs)
358 else: # it's a class instance
359 try:
--> 360 result = func(self, *args, **kwargs)
361 except: # remove the wrapper from the stack trace
362 tp, exc, tb = sys.exc_info()
File [/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/fits/gbtfitsload.py:650](http://thales.gb.nrao.edu:9035/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/fits/gbtfitsload.py#line=649), in GBTFITSLoad.flag(self, tag, **kwargs)
631 @log_call_to_history
632 def flag(self, tag=None, **kwargs):
633 """Add one or more exact flag rules, e.g., `key1 = value1, key2 = value2, ...`
634 If `value` is array-like then a match to any of the array members will be selected.
635 For instance `flag(object=['3C273', 'NGC1234'])` will flag data for either of those
(...)
648
649 """
--> 650 self._flag.flag(tag=tag, **kwargs)
File [/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/util/selection.py:1005](http://thales.gb.nrao.edu:9035/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/util/selection.py#line=1004), in Flag.flag(self, tag, **kwargs)
1003 chan = kwargs.pop("chan", None)
1004 self._handle_channel(chan)
-> 1005 self._base_select(tag, **kwargs)
File [/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/util/selection.py:491](http://thales.gb.nrao.edu:9035/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/util/selection.py#line=490), in SelectionBase._base_select(self, tag, **kwargs)
475 def _base_select(self, tag=None, **kwargs):
476 """Add one or more exact selection[/flag](http://thales.gb.nrao.edu:9035/flag) rules, e.g., `key1 = value1, key2 = value2, ...`
477 If `value` is array-like then a match to any of the array members will be selected[/flagged.](http://thales.gb.nrao.edu:9035/flagged.)
478 Derived classes will call this method with their own specific name, i.e. `select` or `flag`.
(...)
489
490 """
--> 491 self._check_keys(kwargs.keys())
492 row = {}
493 # if called via _select_from_mixed_kwargs, then we want to merge all the
494 # selections
File [/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/util/selection.py:319](http://thales.gb.nrao.edu:9035/home/sandboxes/psalas/Dysh/dysh-clean/src/dysh/util/selection.py#line=318), in SelectionBase._check_keys(self, keys)
317 unrecognized.append(k)
318 if len(unrecognized) > 0:
--> 319 raise KeyError(f"The following keywords were not recognized: {unrecognized}")
KeyError: "The following keywords were not recognized: ['SUBOBSMODE']" Other than that it looks good. |
…lear() method in SelectionBase.
for more information, see https://pre-commit.ci
For future reference: |
This PR contains
What is not contained:
This PR should not be merged until after #395, #392, #388