2510 hi goodtimes set up cli call to processing 1#2779
2510 hi goodtimes set up cli call to processing 1#2779subagonsouth wants to merge 10 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements the top-level Hi goodtimes orchestrator function and integrates it with the CLI for IMAP-Hi L1C goodtimes processing. The goodtimes processing identifies and culls bad time intervals for Hi sensor data using 6 different filtering algorithms (incomplete spin sets, DRF times, overflow packets, and 3 statistical filters). The implementation includes repointing availability checks to ensure sufficient surrounding pointings exist for statistical analysis before proceeding with processing.
Changes:
- Added hi_goodtimes() orchestrator function and helper functions (_find_current_pointing_index, _apply_goodtimes_filters, _write_goodtimes_output) to manage the goodtimes culling workflow
- Integrated goodtimes processing into the CLI with proper dependency validation and CDF loading
- Updated sensor naming convention from "Hi45"/"Hi90" to "sensor45"/"sensor90" to maintain consistency
- Added comprehensive test coverage for the new orchestrator, helpers, and CLI integration
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| imap_processing/hi/hi_goodtimes.py | Adds hi_goodtimes() orchestrator and helper functions for goodtimes processing; updates sensor naming convention in create_goodtimes_dataset() |
| imap_processing/cli.py | Adds L1C goodtimes processing branch in Hi.do_processing() with dependency validation and CDF loading; refactors L1C pset processing into explicit elif branch |
| imap_processing/tests/hi/test_hi_goodtimes.py | Adds comprehensive test coverage for new functions (TestFindCurrentPointingIndex, TestWriteGoodtimesOutput, TestApplyGoodtimesFilters, TestHiGoodtimes); updates sensor names in existing tests |
| imap_processing/tests/test_cli.py | Adds test_hi_l1c_goodtimes for CLI integration testing; updates parametrize decorator in test_hi to include data_descriptor parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
imap_processing/cli.py
Outdated
| def do_processing( # noqa: PLR0912 | ||
| self, dependencies: ProcessingInputCollection | ||
| ) -> list[xr.Dataset]: |
There was a problem hiding this comment.
The return type annotation for Hi.do_processing should be list[xr.Dataset | Path] instead of list[xr.Dataset] because the goodtimes processing path returns a list of Path objects (line 858). This is consistent with the Spacecraft instrument's do_processing method which also returns list[xr.Dataset | Path] and aligns with the post_processing method's signature which accepts list[xr.Dataset | Path].
Add test coverage for Hi goodtimes
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add goodtimes.finalize_dataset accessor function Add yaml metadata for Hi Goodtimes
4b8d4c3 to
3d022e1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
tech3371
left a comment
There was a problem hiding this comment.
goodtimes file has lot going on but it was easy to follow and understand on high-level. Looks good to me.
imap_processing/hi/hi_goodtimes.py
Outdated
| Notes | ||
| ----- | ||
| The output filename follows the pattern: | ||
| imap_hi_sensor{45|90}-goodtimes_{start_date}_{start_date}_{version}.txt |
There was a problem hiding this comment.
is two start_date intentional or type? And are you going to convert goodtimes to CDF in future PR or is that still being decided?
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Change Summary
Overview
This PR adds the top-level hi_goodtimes orchestrator function and integrates it with the CLI for IMAP-Hi L1B goodtimes processing.
Changes
imap_processing/hi/hi_goodtimes.py
imap_processing/cli.py
imap_processing/tests/hi/test_hi_goodtimes.py
imap_processing/tests/test_cli.py
Closes: #2510