Conversation
# Conflicts: # imap_processing/tests/ultra/unit/test_lookup_utils.py # imap_processing/tests/ultra/unit/test_ultra_l1b.py # imap_processing/ultra/l1b/lookup_utils.py
# Conflicts: # imap_processing/tests/ultra/unit/test_lookup_utils.py # imap_processing/ultra/l1b/lookup_utils.py
lacoak21
requested review from
bryan-harter,
leowerneck and
tmplummer
and
a balanced review from Copilot
October 1, 2026 21:40
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Out-of-range voltage samples can flag the final complete bin, and one validation test uses the wrong pointing configuration.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Wires pointing-specific extended-spin thresholds into ULTRA L1B culling and aligns validation with updated algorithms.
Changes:
- Sources voltage and energy thresholds from
ExtendedSpinConfig. - Updates culling behavior for smoothing, Earth-angle filtering, and trailing bins.
- Refreshes validation tests for repoint 383.
| File | Description |
|---|---|
constants.py |
Removes superseded culling constants. |
extendedspin.py |
Passes configured thresholds and uses priority-1 DE. |
lookup_utils.py |
Clarifies threshold ordering and units. |
ultra_l1b_culling.py |
Updates culling and bin-handling logic. |
test_ultra_l1b_culling.py |
Updates unit and validation coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ) | ||
| lv_flags = flag_low_voltage(spin_tbin_edges, status_ds, lv_threshold) | ||
| lv_flags = flag_low_voltage( | ||
| spin_tbin_edges, status_ds, REPOINT_47_SPIN_CONFIG.voltage_threshold |
| # For each low voltage time, find the corresponding spin time | ||
| lv_spin_inds = np.atleast_1d( | ||
| np.searchsorted(spin_tbin_edges, low_voltage_times, side="right") - 1 | ||
| np.searchsorted(spin_tbin_edges[:-1], low_voltage_times, side="right") - 1 |
Comment on lines
+67
to
+69
| # Use the priority 1 de for the spin level quantities since it contains all events. | ||
| # The energy dependent culling selects its de dataset per energy range. | ||
| de_dataset = de_datasets["p0"] | ||
| priority_1_de_dataset = de_datasets["p1"] |
This branch has not been deployed
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
Overview
Wire up the values from the ExtendedSpinConfig class to the culling algorithms.
File changes
-imap_processing/ultra/l1b/ultra_l1b_culling.py
Testing
imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py
Most of the updates in this file are to switch over to use data from a new repoint (This repoint contains a lot of culled events so is a good one to test with)