2374 part2 lo l2 - add get_pset_directional_mask function to mapper tools#2387
Merged
tmplummer merged 2 commits intoIMAP-Science-Operations-Center:devfrom Nov 7, 2025
Conversation
0e74b3c to
d9325da
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors duplicated code for directional masking into a reusable function get_pset_directional_mask(). The function extracts the logic for selecting ram, anti-ram, or full-spin data from pointing sets, which was previously duplicated in hi_l2.py.
- Introduces a new utility function
get_pset_directional_mask()incorrections.py - Refactors
hi_l2.pyto use the new function instead of inline logic - Adds comprehensive test coverage for the new function
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| imap_processing/ena_maps/utils/corrections.py | Adds new get_pset_directional_mask() function to centralize directional masking logic |
| imap_processing/hi/hi_l2.py | Refactors to use the new utility function, removing duplicated inline code |
| imap_processing/tests/ena_maps/test_corrections.py | Adds comprehensive test suite for the new function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
greglucas
approved these changes
Nov 6, 2025
30e356c
into
IMAP-Science-Operations-Center:dev
30 checks passed
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
This PR adds the
get_pset_directional_maskfunction to the corrections.py module. This is a helper function to get a pixel mask to pass to theAbstractSkyMap.project_pset_values_to_map()method that will filter ram/anti-ram pixels during the projection step.Updated Files
get_pset_directional_maskhelper functionget_pset_directional_maskhelper funcitonRelated to: #2374