sot / proseco

Probabilistic star evaluation and catalog optimization
https://sot.github.io/proseco
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Exclude guide star if it overlaps with brighter/better guide star #370

Closed jeanconn closed 2 years ago

jeanconn commented 2 years ago

Description

Exclude a guide star if it overlaps in pixel space with brighter/better guide star.

This PR adds a guide star selection check that guide stars are not within 12 pixels. The PEA will drop a readout window if it actually overlaps another during the current cycle; this check should preclude star selection that would allow that. If one or both of the close guide stars in a pair are included with include_ids(_guide) they will still be included.

This was noticed in obsids 45890 and 45884 in NOV2921A.

Testing

jeanconn commented 2 years ago

In [1]: import proseco                                                                                

In [2]: import pickle                                                                                 

In [3]: import gzip                                                                                   

In [4]: acas = pickle.load(gzip.open('/data/mpcrit1/mplogs/2021/NOV2921/oflsa/output/NOV2921A_proseco.
   ...: pkl.gz'))                                                                                     

In [5]: args = acas[45890].call_args.copy()                                                                                                                 

In [6]: cat = proseco.get_aca_catalog(**args)

In [7]: cat                                                                                                                                                 
Out[7]: 
<ACATable length=9>
 slot  idx      id    type  sz   p_acq    mag    maxmag   yang     zang    dim   res  halfw
int64 int64   int64   str3 str3 float64 float64 float64 float64  float64  int64 int64 int64
----- ----- --------- ---- ---- ------- ------- ------- -------- -------- ----- ----- -----
    0     1 191765688  BOT  8x8   0.981    6.83    8.33  1947.21  1921.32    28     1   160
    1     2 191759008  BOT  8x8   0.978    7.02    8.52  2411.72  -181.47    28     1   160
    2     3 191766032  BOT  8x8   0.979    8.13    9.63    75.61 -1651.00    28     1   160
    3     4 191758776  BOT  8x8   0.973    8.63   10.13   422.49  -100.83    28     1   160
    4     5 191759456  BOT  8x8   0.963    9.01   10.51   428.90 -2444.05    28     1   160
    5     6 191765024  BOT  8x8   0.963    9.08   10.58  -456.20 -2064.06    28     1   160
    6     7 191765576  BOT  8x8   0.815    9.66   11.16  -925.24  1743.10    24     1   140
    7     8 191764552  GUI  8x8   0.000   10.02   11.20  1945.95  2019.31     1     1    25
    7     9 191758592  ACQ  8x8   0.664    9.37   10.87  2472.67 -1144.07    28     1   160

In [8]: 191762344 in cat['id']                                                                                                                              
Out[8]: False

In [9]: 191765024 in cat['id']                                                                                                                              
Out[9]: True

In [11]: cat.guides.reject_info[-1]                                                                                                                         
Out[11]: 
{'id': 191762344,
 'type': 'overlap',
 'text': 'Cand 191762344 has track overlap with 191765024'}
jeanconn commented 2 years ago

@taldcroft What do you want the behavior to be if one or both of the pair of stars are in include_ids_guide? Exclude as needed or just warn in sparkles?

taldcroft commented 2 years ago

What do you want the behavior to be if one or both of the pair of stars are in include_ids_guide? Exclude as needed or just warn in sparkles?

If one of the pair of stars is in include_ids_guide then it should be the selected star. If both are included in the list then they should both be selected. That's the API for include_ids_guide (do what I say, not what you think is best for me).

jeanconn commented 2 years ago

Right, there's some precedent for not allowing an "unselectable" star even if in the include_ids_guide but fine to handle this like the other "bad idea but not precluded" cases.