Skip to content

2374 part2 lo l2 - add get_pset_directional_mask function to mapper tools#2387

Merged
tmplummer merged 2 commits intoIMAP-Science-Operations-Center:devfrom
tmplummer:2374-part2-lo-l2---integrate-cg-correction-for-hf-maps
Nov 7, 2025
Merged

2374 part2 lo l2 - add get_pset_directional_mask function to mapper tools#2387
tmplummer merged 2 commits intoIMAP-Science-Operations-Center:devfrom
tmplummer:2374-part2-lo-l2---integrate-cg-correction-for-hf-maps

Conversation

@tmplummer
Copy link
Copy Markdown
Contributor

Change Summary

Overview

This PR adds the get_pset_directional_mask function to the corrections.py module. This is a helper function to get a pixel mask to pass to the AbstractSkyMap.project_pset_values_to_map() method that will filter ram/anti-ram pixels during the projection step.

Updated Files

  • imap_processing/ena_maps/utils/corrections.py
    • Add get_pset_directional_mask helper function
    • description of change 2 in file 2
  • imap_processing/hi/hi_l2.py
    • Use new get_pset_directional_mask helper funciton
  • imap_processing/tests/ena_maps/test_corrections.py
    • Add test coverage for new function

Related to: #2374

@tmplummer tmplummer self-assigned this Nov 5, 2025
@tmplummer tmplummer added the Mapper Tools Work related to common mapper tools label Nov 5, 2025
@tmplummer tmplummer added this to IMAP Nov 5, 2025
@tmplummer tmplummer force-pushed the 2374-part2-lo-l2---integrate-cg-correction-for-hf-maps branch from 0e74b3c to d9325da Compare November 5, 2025 22:05
@tmplummer tmplummer requested a review from Copilot November 6, 2025 21:01
Copy link
Copy Markdown
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 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() in corrections.py
  • Refactors hi_l2.py to 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.

@tmplummer tmplummer merged commit 30e356c into IMAP-Science-Operations-Center:dev Nov 7, 2025
30 checks passed
@github-project-automation github-project-automation bot moved this to Done in IMAP Nov 7, 2025
@tmplummer tmplummer deleted the 2374-part2-lo-l2---integrate-cg-correction-for-hf-maps branch November 7, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mapper Tools Work related to common mapper tools

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants