Fix computed Comp_Quat class and close pickle files #260
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
The
Computed_Quat
computed MSID is broken when there are actual bad data in the fetch range. The resultantMsid
object hasvals
that are not filtered. This happens for samples at ['2024:064:09:27:02.652' '2024:064:09:27:03.677']. This problem has stopped updates to the Kalman watch perigee monitor window data page since around day 063.The root cause of the problem was checking that a computed attribute (including
times
,vals
,bads
,units
) is a subclass ofndarray
. For the computed quaternion this is not the case, instead it is just follows (somewhat) the array protocol. For the purposes here I just check for ashape
attribute.This includes a change that was required by the new test. The goal was to show that no warnings are issued when fetching data over the impacted time range. However, the idiom of reading a pickle file with
pickle.load(open(filename, "rb"))
issues a ResourceWarning. This is a bit funky because pytest normally ignores that (probably because it is so common), but anyway it was getting in the way of the test I wrote, which technically passed but gave the warning below. This is just a mess so I decided to fix the source of the problem.Interface impacts
None
Testing
Unit tests
Independent check of unit tests by Jean
Functional tests
In HEAD flight ska3 I ran this to https://icxc.cfa.harvard.edu/aspect/test_review_outputs/cheta/cheta-pr260/kalman_flight/
which shows Kalman data for the last year and that the monitor window job did not create output (error).
PR output to https://icxc.cfa.harvard.edu/aspect/test_review_outputs/cheta/cheta-pr260/kalman_pr/ with same Kalman output except monitor plot made.