Fix continuity and states for start within maneuver #176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a slightly subtle bug that showed up in acisops/acis_thermal_check#30 (comment). When requesting states starting within a maneuver it could happen that
datestart > datestop
in the first state. The firstdatestart
was incorrect, but otherwise the state values were good. For example:This is a consequence of the way maneuvers are handled, in particular that there is a command AOMANUVR that kicks off a maneuver and internally a number of pseudo-commands are injected in order to change the attitude and pitch, yaw, roll etc appropriately.
When calling
get_states
without a continuity specified, it first gets continuity for the start date. The bug here was that the continuity was providing continuity at the time of the AOMANUVR command, which would be OK except that the subsequent states processing was aware of the pseudo-commands that followed and created states accordingly. However, the states code assumes that the first state contains the continuity time. It explicitly sets thedatestart
of the first state to the input start time based on that assumption, but in this case a couple of new states due to the pseudo-commands were intervening and so the inconsistency appeared.The fix is to ensure that the states which are generated in order to determine continuity go out to the desired continuity date instead of the time of the last actual (non-pseudo) command before that date. That gets everybody on the same page.
Testing
Functional testing
Confirmed that this fixes the original issue noted in acisops/acis_thermal_check#30 (comment)