IDEX l2b 10-day refactor - #3408
Open
lacoak21 wants to merge 2 commits into
Open
Conversation
lacoak21
requested review from
bryan-harter and
tech3371
and
a lite review from Copilot
August 25, 2026 16:30
Contributor
There was a problem hiding this comment.
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). Usings^-1here 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). Usings^-1here 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 |
Collaborator
|
LGTM |
lacoak21
force-pushed
the
idex_l2b_refactor
branch
from
August 27, 2026 20:57
a4420ab to
817768c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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