Skip to content

HIT L3: moved 10-minute chunking transformation to HIT L2 - #161

Merged
jtniehof merged 2 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:lw/issue143
Sep 1, 2026
Merged

HIT L3: moved 10-minute chunking transformation to HIT L2#161
jtniehof merged 2 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:lw/issue143

Conversation

@leowerneck

@leowerneck leowerneck commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Change Summary

Closes #143.

Overview

This PR removes HIT macropixel 10-minute chunk transformation from L3. The transformation and corrected epoch handling are now performed in L2 by imap_processing PR 3377 that closes issue 3327 of that repository.

L3 now consumes the corrected epochs, five-minute epoch deltas, and consolidated macropixel data directly from the L2 CDF.

File changes

  • imap_l3_processing/hit/l3/sectored_products/science/sectored_products_algorithms.py
    • Removed transform_to_10_minute_chunks, which is now performed in L2.
    • Removed imports that were only used by that function.
  • imap_l3_processing/hit/l3/hit_processor.py
    • Removed the call to transform_to_10_minute_chunks.
    • Uses dependencies.data directly because it now has the expected 10-minute format.
  • imap_l3_processing/hit/l3/utils.py
    • Removed the logic that fabricated epoch deltas from adjacent epochs.
    • Reads epoch_delta directly from the L2 CDF and converts it from nanoseconds to timedelta values.
  • tests/hit/l3/sectored_products/science/test_sectored_products_algorithms.py
    • Removed test_transform_to_10_minute_chunks and its unused imports.
  • tests/hit/l3/test_hit_processor.py
    • Removed mocking and assertions associated with transform_to_10_minute_chunks.
    • Updated the test dependencies to provide the already-transformed L2 data directly.
  • tests/hit/l3/test_utils.py
    • Updated generated test CDFs to include epoch_delta.
    • Updated assertions to expect the five-minute delta supplied by L2.
    • Removed the obsolete test for failures while fabricating epoch deltas.

Testing

Ran the affected HIT L3 unit tests:

uv run python -m unittest \
    tests.hit.l3.sectored_products.science.test_sectored_products_algorithms \
    tests.hit.l3.test_hit_processor \
    tests.hit.l3.test_utils

All 9 tests passed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Moves HIT 10-minute macropixel consolidation from L3 to L2, addressing issue #143.

Changes:

  • Removes L3 chunking logic and uses consolidated L2 data directly.
  • Reads five-minute epoch deltas from L2 CDFs.
  • Updates affected unit tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
imap_l3_processing/hit/l3/hit_processor.py Passes L2 data directly into processing.
imap_l3_processing/hit/l3/utils.py Reads supplied epoch deltas.
imap_l3_processing/hit/l3/sectored_products/science/sectored_products_algorithms.py Removes obsolete consolidation logic.
tests/hit/l3/test_hit_processor.py Updates processor mocks and expectations.
tests/hit/l3/test_utils.py Adds epoch-delta test data and assertions.
tests/hit/l3/sectored_products/science/test_sectored_products_algorithms.py Removes obsolete transformation tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

return HitL2Data(
epoch=cdf["epoch"][...],
epoch_delta=fabricated_epoch_deltas,
epoch_delta=cdf["epoch_delta"][...] / 1e9 * timedelta(seconds=1),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Since L2 is also being updated, the issue raised by this comment is a red herring.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Although the test data that's checked in to the repo will need to be updated.

@leowerneck
leowerneck requested a review from jtniehof August 18, 2026 19:47
@leowerneck leowerneck self-assigned this Aug 18, 2026
@leowerneck leowerneck added Data Release 2 Deadline: September 1, 2026 Ins: HIT Related to the HIT instrument labels Aug 18, 2026
@pleasant-menlo

Copy link
Copy Markdown
Collaborator

This all looks good once the l2 test file is updated so that the HIT integration test can pass.

@leowerneck

leowerneck commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

@pleasant-menlo @jtniehof I updated the L2 file. The HIT integration test is passing. Let me know if there's anything else to be done in this PR.

@jtniehof jtniehof left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm good here. Will be out of pocket for the day, so going to go ahead and merge now and we can patch up any concerns later.

@jtniehof
jtniehof merged commit 82b1e48 into IMAP-Science-Operations-Center:main Sep 1, 2026
16 of 17 checks passed
@leowerneck
leowerneck deleted the lw/issue143 branch September 1, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Data Release 2 Deadline: September 1, 2026 Ins: HIT Related to the HIT instrument

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HIT - Update handling of epochs with new L2 sectored input HIT Sector Data Epoch Update

4 participants