Skip to content

Rename function to find_last_de_packet_data#2671

Merged
subagonsouth merged 4 commits intoIMAP-Science-Operations-Center:devfrom
subagonsouth:2667-hi---ensure-number-of-de-packets-per-8-spin-is-flexible
Feb 6, 2026
Merged

Rename function to find_last_de_packet_data#2671
subagonsouth merged 4 commits intoIMAP-Science-Operations-Center:devfrom
subagonsouth:2667-hi---ensure-number-of-de-packets-per-8-spin-is-flexible

Conversation

@subagonsouth
Copy link
Contributor

Remove logic that checks for 2 DE packets at each ESA step

Change Summary

Hi told me that the instrument will not always be configured to have 2 DE packets per 8-spin ESA step. This was a minor change to remove the references to the 2 DE packets. It also removes some logic that would remove last packet indices if 2 packets at that ESA are not present. This logic duplicates a check that occurs in Hi Goodtimes.

Remove logic that checks for 2 DE packets at each ESA step
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request renames the function find_second_de_packet_data to find_last_de_packet_data and removes logic that assumed exactly 2 DE packets per ESA step. The instrument can now be configured with 2, 4, or 8 DE packets per 8-spin ESA step, so the previous pair-checking logic has been removed as it's redundant with checks performed in Hi Goodtimes processing.

Changes:

  • Renamed find_second_de_packet_data to find_last_de_packet_data to reflect that it finds the last packet in each set (not necessarily the second in a pair)
  • Updated comments to reference "2, 4, or 8 CCSDS packets" instead of assuming 2 packets per ESA step
  • Removed validation logic that checked for exactly 2 packets at each ESA step and filtered out unpaired packets
  • Updated test cases to reflect the new expected behavior where all last packets are kept (not just paired ones)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
imap_processing/hi/hi_l1c.py Renamed function from find_second_de_packet_data to find_last_de_packet_data, updated docstring and comments to reflect new packet count flexibility (2, 4, or 8 packets), removed pair validation logic
imap_processing/tests/hi/test_hi_l1c.py Updated mock decorators, mock variable names, test comments, and expected test results to match the renamed function and new logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +612 to +614
# indices of those changes to identify the last packet in each set. We
# also need to add the final packet index and assume an energy step change
# occurs after the final packet.
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment at line 608 in the function body still refers to "the second packet in each pair of DE packets" but should be updated to "the last packet in each set of DE packets" to be consistent with the new logic that supports 2, 4, or 8 packets per ESA step (not just pairs).

Copilot uses AI. Check for mistakes.
subagonsouth and others added 2 commits February 5, 2026 17:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@subagonsouth subagonsouth merged commit e64ad41 into IMAP-Science-Operations-Center:dev Feb 6, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this to Done in IMAP Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants