Hi L1B DE: carry last_spin_num into output and add BADSPIN ccsds_qf flag#2754
Hi L1B DE: carry last_spin_num into output and add BADSPIN ccsds_qf flag#2754subagonsouth merged 7 commits intodevfrom
Conversation
…flag Co-authored-by: subagonsouth <16110870+subagonsouth@users.noreply.github.com>
| assert result["ccsds_qf"].values[0] == 0 | ||
| assert result["ccsds_qf"].values[1] == ImapHiL1bDeFlags.SPIN_INVALID | ||
| assert result["ccsds_qf"].values[2] == 0 |
There was a problem hiding this comment.
| assert result["ccsds_qf"].values[0] == 0 | |
| assert result["ccsds_qf"].values[1] == ImapHiL1bDeFlags.SPIN_INVALID | |
| assert result["ccsds_qf"].values[2] == 0 | |
| np.testing.assert_equal(result["ccsds_qf"].values, [0, ImapHiL1bDeFlags.SPIN_INVALID, 0]) |
| expected = ImapHiL1bDeFlags.PACKET_FULL | ImapHiL1bDeFlags.SPIN_INVALID | ||
| assert result["ccsds_qf"].values[0] == expected | ||
| assert result["ccsds_qf"].values[1] == 0 |
There was a problem hiding this comment.
| expected = ImapHiL1bDeFlags.PACKET_FULL | ImapHiL1bDeFlags.SPIN_INVALID | |
| assert result["ccsds_qf"].values[0] == expected | |
| assert result["ccsds_qf"].values[1] == 0 | |
| np.testing.assert_array_equal( | |
| result["ccsds_qf"].values, | |
| [ImapHiL1bDeFlags.PACKET_FULL | ImapHiL1bDeFlags.SPIN_INVALID, 0], | |
| ) |
subagonsouth
left a comment
There was a problem hiding this comment.
@copilot please see my comments and fix the issues that I identified.
Co-authored-by: subagonsouth <16110870+subagonsouth@users.noreply.github.com>
subagonsouth
left a comment
There was a problem hiding this comment.
@copilot, please evaluate if np.testing.assert_equal, or np.testing.assert_array_equal should be used and make both cases use the same.
Co-authored-by: subagonsouth <16110870+subagonsouth@users.noreply.github.com>
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
laspsandoval
left a comment
There was a problem hiding this comment.
Looks good. A couple of things to think about.
|
@copilot, please make two changes based on reviews.
|
Co-authored-by: subagonsouth <16110870+subagonsouth@users.noreply.github.com>
Done in da732c2. |
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
last_spin_numwas being dropped from L1A→L1B DE processing, and there was no quality flag to signal packets containing events from invalid spins.Changes Made
quality_flags.py: AddedBADSPIN = ENAFlags.BADSPIN(bit 2, value 4) toImapHiL1bDeFlags, reusing the existing sharedENAFlags.BADSPINflag rather than a custom flag.hi_l1b.py:last_spin_numfromdrop_vars— it now passes through to L1B with unchanged variable attributes.de_ccsds_qf(): setsBADSPINflag (bitwise OR) on any packet wherespin_invalids != 0; check is placed before the early-return guard so it applies even when no valid direct events exist.imap_hi_variable_attrs.yaml: UpdatedVAR_NOTESforhi_de_ccsds_qfto document both flags — Bit 0 (PACKET_FULL) and Bit 2 (BADSPIN).test_hi_l1b.py: Addedspin_invalidsto existing test datasets; added two new test methods usingnp.testing.assert_array_equal; updateddata_varscount assertions from 17 to 18.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.