Skip to content

IDEX l2b 10-day refactor - #3408

Open
lacoak21 wants to merge 2 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:idex_l2b_refactor
Open

IDEX l2b 10-day refactor#3408
lacoak21 wants to merge 2 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:idex_l2b_refactor

Conversation

@lacoak21

@lacoak21 lacoak21 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Change Summary

closes #3403

Overview

The IDEX team would like the l2b and l2c products to be at the same 10-day cadence as the upstream products. This is because they are getting fewer dust hits than expected. This simplifies the l2b code a lot.

Instead of having a month of rates and counts every day, they would like just one single rate /count over the 10-day period.
The units are still the same but the calculation gets simplified.

File changes

  • imap_processing/cdf/config/imap_idex_l2b_variable_attrs.yaml
    • I realized this UNIT was wrong from the start. Its per seconds not per day.
  • imap_processing/idex/idex_l2b.py
    • update l2b products to be at 10-day cadence

@lacoak21
lacoak21 requested review from bryan-harter and tech3371 and a lite review from Copilot August 25, 2026 16:30
@lacoak21 lacoak21 self-assigned this Aug 25, 2026
@lacoak21 lacoak21 added this to IMAP Aug 25, 2026

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

Refactors IDEX L2B/L2C science products from a monthly/daily cadence to a single aggregated record per 10-day window, aligning product cadence with upstream IDEX processing and updating CDF metadata accordingly.

Changes:

  • Aggregate L2B/L2C counts and rates across the full 10-day window into a single epoch record (removing per-day DOY handling).
  • Replace daily science-acquisition “percent on” logic with window-level on-time/total-time accumulation for rate computation.
  • Update global/variable CDF attributes and unit metadata for 10-day products; adjust/expand unit tests for new cadence and filenames.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
imap_processing/tests/idex/test_idex_l2b.py Updates tests for 10-day logical sources, single-epoch outputs, and new uptime/rate APIs.
imap_processing/idex/idex_l2b.py Implements 10-day aggregation, updates count/rate computation, and replaces uptime calculation API.
imap_processing/cdf/config/imap_idex_l2c_variable_attrs.yaml Updates rate variable descriptions/units for 10-day cadence.
imap_processing/cdf/config/imap_idex_l2b_variable_attrs.yaml Updates rate variable descriptions/units and removes DOY variable attrs.
imap_processing/cdf/config/imap_idex_global_cdf_attrs.yaml Updates global attributes for L2B/L2C logical sources and data types to 10-day products.
Suppressed comments (2)

imap_processing/cdf/config/imap_idex_l2b_variable_attrs.yaml:120

  • Per-second units in this repo’s CDF attrs are typically expressed as 1/s (e.g., imap_ultra_l1b_variable_attrs.yaml). Using s^-1 here is inconsistent and can trip downstream unit parsing.
    CATDESC: Count rate by mass and spin phase over the 10-day window.
    DICT_KEY: SPASE>Particle>ParticleType:Dust,ParticleQuantity:CountRate,Qualifier:Array
    FIELDNAM: Rate by Mass
    FILLVAL: *double_fillval
    UNITS: s^-1

imap_processing/cdf/config/imap_idex_l2c_variable_attrs.yaml:120

  • Per-second units in this repo’s CDF attrs are typically expressed as 1/s (e.g., imap_ultra_l1b_variable_attrs.yaml). Using s^-1 here is inconsistent and can trip downstream unit parsing.
  CATDESC: Count rate by mass, longitude, and latitude over the 10-day window.
  DICT_KEY: SPASE>SupportQuantity:CountRate,Qualifier:Array
  FIELDNAM: Rate by Mass Map
  FILLVAL: *double_fillval
  UNITS: s^-1

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

Comment on lines +451 to +452
# The epoch for the window record is the mean epoch of all events in the window.
window_epoch = np.array([np.mean(l2a_dataset["epoch"].data)])
"""Test that the function produces -1 rates when hk data isn't available."""
def test_compute_rates_by_charge_and_mass_no_acquisition_data(caplog):
"""Test that the function produces -1 rates when there is no uptime data."""
caplog.at_level("WARNING")
Comment on lines +108 to +112
CATDESC: Count rate by impact charge and spin phase over the 10-day window.
DICT_KEY: SPASE>Particle>ParticleType:Dust,ParticleQuantity:CountRate,Qualifier:Array
FIELDNAM: Rate by Charge
FILLVAL: *double_fillval
UNITS: day^-1
UNITS: s^-1
Comment on lines +92 to +96
CATDESC: Count rate by impact charge, longitude, and latitude over the 10-day window.
DICT_KEY: SPASE>SupportQuantity:CountRate,Qualifier:Array
FIELDNAM: Rate by Charge Map
FILLVAL: *double_fillval
UNITS: day^-1
UNITS: s^-1
@aldo9253

Copy link
Copy Markdown
Collaborator

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

IDEX L2B change to 10 day cadence

3 participants