Closed jeanconn closed 4 years ago
Are we thinking about backports to ska2? I suppose I also need to test and update the scs107 directions to use ska3 (whinch may be shiny... not sure about our promotion plan).
Good point about the ternary. I think here I don't mind seeing more lines of code because it does deserve a bit of attention.
This should prevent recurrence of sot/timelines#24 without any side-effects.
Not completely without any side effects. :smile:
Kadi.commands uses the following to select commands within timeline segments:
# Only store commands for this timeline (match SCS and date)
bs_cmds = [x for x in bs_cmds
if tl['datestart'] <= x['date'] <= tl['datestop']
and x['scs'] == tl['scs']]
So if there is a command that is exactly at tl['datestart']
and tl['datestop']
then it gets accepted. This happens for some AOACRSTD in real life (e.g. the 2021:296 NSM interrupt).
Question: is the datestop
supposed to be inclusive? Should I write if tl['datestart'] <= x['date'] < tl['datestop']
or should we clip datestop
(for an interrupt) to 1 ms earlier?
ANSWER: Yes, it is inclusive (from examining some loads and the corresponding timelines). So we may need to clip to 1 ms earlier.
Description
Set interrupt_loads to shorten timelines only as short as zero length. This sets the timelines to not have negative duration. This should prevent recurrence of https://github.com/sot/timelines/issues/24 without any side-effects.
Testing
I tested just with sqlite and confirmed expected datestop values by eye, with an interrupt time set to '2020:266:14:48:29.000' in full interrupt and observing_only modes.
Fixes https://github.com/sot/timelines/issues/24