Skip to content

Conversation

@lacoak21
Copy link
Contributor

Change Summary

Overview

Determine when the rates dataset was in sectored mode by looking at the spin numbers vs checking the params packet. This is more accurate / simpler/ and what the ULTRA IT does. They will be updating the algorithm document.

Updated Files

  • imap_processing/tests/ultra/unit/conftest.py
    • Remove fixture - l1c does not need the params dataset anymore. I also discovered there was already a fixture for the rates dataset
  • imap_processing/ultra/l1c/helio_pset.py and imap_processing/ultra/l1c/spacecraft_pset.py and imap_processing/ultra/l1c/ultra_l1c.py
    • remove params dataset from parameters
  • imap_processing/ultra/l1c/ultra_l1c_pset_bins.py
    • Update deadtime calculation function. Use the algorithm documents version instead of the powerpoint version.
    • Determine sectored rates data by checking the spins
    • Determine spin phase logically instead of with SPICE - we can assume each sector 0 starts at spin phase 0

Testing

Fix tests, remove params datasets

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 refactors the ULTRA L1c deadtime correction algorithm to determine sectored mode data by examining spin numbers in the rates dataset, rather than checking the params packet. The implementation now matches what the ULTRA instrument team uses and simplifies the codebase by removing the dependency on the params dataset.

Key Changes

  • Updated deadtime calculation formula to match the algorithm document (instead of PowerPoint version)
  • Changed sectored mode detection to use spin number analysis instead of params packet
  • Removed params_dataset parameter from multiple functions across the L1c processing pipeline

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
imap_processing/ultra/l1c/ultra_l1c_pset_bins.py Core algorithm changes: new sectored rates detection logic, updated deadtime ratio calculation with spin duration parameter, and direct spin phase calculation
imap_processing/ultra/l1c/ultra_l1c.py Removed params_dataset parameter from function calls for helio and spacecraft pset calculations
imap_processing/ultra/l1c/spacecraft_pset.py Removed params_dataset parameter from calculate_spacecraft_pset function signature and docstring
imap_processing/ultra/l1c/helio_pset.py Removed params_dataset parameter from calculate_helio_pset function signature and docstring
imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py Updated tests to match new function signatures, added manual test for sectored rates detection
imap_processing/tests/ultra/unit/test_ultra_l1c.py Updated test fixtures to use rates_dataset instead of deadtime_datasets
imap_processing/tests/ultra/unit/test_spacecraft_pset.py Updated test fixtures to use rates_dataset instead of deadtime_datasets
imap_processing/tests/ultra/unit/conftest.py Removed deadtime_datasets fixture and cleaned up random_spin_data fixture

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

Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Looks good, feel free to take/leave the comments as you see fit.

@lacoak21 lacoak21 force-pushed the ultra_l1c_fix_deadtime_correction branch from 550dca9 to ed7a306 Compare December 18, 2025 16:44
@lacoak21 lacoak21 merged commit 098a804 into IMAP-Science-Operations-Center:dev Dec 18, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this to Done in IMAP Dec 18, 2025
@lacoak21 lacoak21 deleted the ultra_l1c_fix_deadtime_correction branch December 18, 2025 17:15
@lacoak21 lacoak21 restored the ultra_l1c_fix_deadtime_correction branch December 18, 2025 17:15
@lacoak21 lacoak21 deleted the ultra_l1c_fix_deadtime_correction branch December 18, 2025 17:15
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