Closed taldcroft closed 2 years ago
I was thinking this would work with more than two commands but not more than two of these types? But haven't checked.
Comment moved here from slack: Do we want to have more notes about the rules of commands somewhere? I'm not sure where I'd look. For this PR, it might just be a comment that the latest the obsid command will be (in nominal ops) is at the time of the maneuver command.
I was thinking this would work with more than two commands but not more than two of these types?
This works only if these two commands are consecutive. There can be multiple appearances of the pair, but if there is something in between them it will not work.
Gotcha. With my understanding of commanding then, I think while that is unlikely (more than 2 commands) it seems like the code should be fixed to fine with any number of commands and commands in between, as long as the output has these two commands in the right order to work with the determination of observations.
The first version of this actually did something robust to having more commands at one time, namely do a sort by date, scs, tlmsid
. This relies on the alphabetic ordering of the relevant commands being (luckily) what we need. I thought this was too hacky though. There are actually cases where there is a SIM command at the same time IIRC. I will look into this a little more.
See 116ae13. I used this version to regenerate the commands archive, then compared all observations from the new version to those from the previous version (corresponding to what I put on HEAD). There were no differences.
That leads me to conclude that the previous method was OK for now, but I'm also happy to have code that is more robust to future changes in the way commands are put together.
Description
As noted in originally in slack there are cases where obsids in nominal schedules had two star catalogs / observations. E.g.
Then obsid=57245 had exactly the same observation info and star catalog. This was due to the obsid and NMM command happening at exactly the same time, but with the obsid before the NMM command. This causes the observation code to assign the second obsid prior (in command order) to the NMM command.
This PR looks through the commands for this situation and swaps the commands.
Interface impacts
None
Testing
Unit tests
Functional tests
With this change I regenerated the
cmds2.*
files and then did this in IPython with the local files. This shows only the one expected observation.