Skip to content

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

Open
leowerneck wants to merge 1 commit into
IMAP-Science-Operations-Center:mainfrom
leowerneck:lw/issue143
Open

HIT L3: moved 10-minute chunking transformation to HIT L2#161
leowerneck wants to merge 1 commit 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

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),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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

2 participants