sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

`sun_pos_mon` state needs sufficient command history #289

Closed taldcroft closed 10 months ago

taldcroft commented 11 months ago

For the sun_pos_mon state, if you set the ‘start’ time to a time during an eclipse after the EOESTECN (battery-connect command?), that EOESTECN command isn’t included in the commands used to determine the states, and then, without that command, the logic fails to construct the automatic sun position monitor state after that eclipse exit.

I’m basically reading this out of https://github.com/sot/kadi/blob/7fe0dd5477e804a216abf388070618d86720e204/kadi/commands/states.py#L729 . So I think we probably need a kadi fix to do something determine if the start time is in an area where this could be a problem and then read back to get more commands if necessary… or something like that (like including something about it in continuity). I note the EOESTECN is at ‘2022:109:21:27:27.034’, so setting start to exactly that works,

ska3-jeanconn-fido> get_chandra_states --start 2022:109:21:27:27.034 --stop 2022:110:00:00:00.000 --state-keys=sun_pos_mon
             datestart               datestop  sun_pos_mon 
 2022:109:21:27:27.034  2022:109:22:14:07.034         DISA 
 2022:109:22:14:07.034  2022:110:00:00:00.000         ENAB 

and one second later does not (to get the ENAB state).

ska3-jeanconn-fido> get_chandra_states --start 2022:109:21:27:28.034 --stop 2022:110:00:00:00.000 --state-keys=sun_pos_mon
             datestart               datestop  sun_pos_mon 
 2022:109:21:27:28.034  2022:110:00:00:00.000         DISA 

See also https://chandramission.slack.com/archives/C019GLX6QEP/p1689303146817899