-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement include/exclude_ids in guide star selection #176
Conversation
This was the most direct hack to accomplish the behavior. I didn't have in mind this use case when doing the original implementation, so it could really use a rewrite to have functions to manipulate the list of candidate stars. |
I may be missing some logic in the code, but here goes: It seems at first glance that you can use almost exactly the code here: And put it here: Basically do exactly all the previous initial guide candidate selection, and at the very end if an included guide star is not in the cand_guide table then do the "bare minimum" validation of the included star and toss it into the candidates list by adding the row into the table. This guarantees the star can be selected. Then you still need the new code to actually select it at stage 0. Likewise after putting in the include stars then check if any cand_guide star is in the exclude list and delete the row in the cand_guides table (and put in the usual logging). This will prevent it from being selected. (BTW, in acq I think I did not take this approach in order to keep the star in the cand_acqs table for visibility since there is no reject logging like guide. In the case of acq the subsequent exclusion was just a couple of lines of code). At any point earlier in the processing you can just check If I haven't misunderstood what's happening, I think doing it like this will be a more confined change. |
proseco/guide.py
Outdated
@@ -261,53 +266,84 @@ def get_initial_guide_candidates(self): | |||
stars = self.stars | |||
dark = self.dark | |||
|
|||
# Use the primary selection filter from acq, but allow bad color | |||
# and limit to brighter stars | |||
ok = ((stars['CLASS'] == 0) & |
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.
A corollary to the recommendation of using ok
for boolean masks is that this should only be done for code that is immediately adjacent. So move this statement down to where it is used.
Thanks @taldcroft .
|
01b90e7
to
c498bde
Compare
I've just updated this to be more consistent with @taldcroft 's vision. There are still compromises in some code that should be addressed in guide star selection, but this is at least a more lean change. |
I ended up not adding back in code to check that include_ids aren't in exclude_ids. |
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.
Looks good!
@@ -36,7 +36,7 @@ def test_get_aca_catalog_20603(): | |||
"""Put it all together. Regression test for selected stars. | |||
""" | |||
# Force not using a bright star so there is a GUI-only (not BOT) star | |||
aca = get_aca_catalog(20603, exclude_ids=[40113544], n_fid=2, n_guide=6, n_acq=7, | |||
aca = get_aca_catalog(20603, exclude_ids_acq=[40113544], n_fid=2, n_guide=6, n_acq=7, |
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.
Related to the discussion in #178, maybe revert this test and then fix the expected catalog to show both guide and acq exclusion of ..3544?
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.
OK. I was thinking that the test coverage of the supported interface was actually better this way ( test_aca_acqs_include_exclude seems to include and exclude the same stars for guide and acq, only via the separate kwargs).
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.
OK fair enough.
Implement include/exclude_ids in guide star selection