Skip to content

Conversation

@lacoak21
Copy link
Contributor

@lacoak21 lacoak21 commented Dec 9, 2025

Change Summary

Overview

Create ultra helio index maps on the fly to be used in the calculation of the exposure factor, efficiencies and geometric function. This is an alternative to reading in many ancillary files. It was decided that writing the code to do this is best incase we need to change it.

Most of the code to produce the index map was written by Claude after importing the Java code that nick uses. There were a few small issues to fix after this.

Updated Files

  • imap_processing/ultra/constants.py
    • Add constants for helio index map creation
  • imap_processing/ultra/l1b/lookup_utils.py
    • Fix inside fov function to match Nicks version (from java code)
  • imap_processing/ultra/l1c/helio_pset.py
    • make index maps on the fly for helio psets.
      -imap_processing/ultra/l1c/l1c_lookup_utils.py
    • Fix valid pixel calculation to handle energy dependent index tables.
  • imap_processing/ultra/l1c/make_helio_index_maps.py
    • code for calculating the helio index maps
  • imap_processing/ultra/l1c/ultra_l1c_pset_bins.py
  • fix code to use energy dependent index maps

Testing

  • validation test for the index maps
  • validation test for helio psets for efficiency and sensitivity values
  • fixed other tests that were effected by the changes

@lacoak21 lacoak21 requested a review from greglucas December 9, 2025 14:55
@lacoak21 lacoak21 self-assigned this Dec 9, 2025
@lacoak21 lacoak21 added this to IMAP Dec 9, 2025
Copy link
Contributor

@subagonsouth subagonsouth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things worth reviewing.

Copy link
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 implements on-the-fly generation of heliocentric HEALPix index maps for ULTRA L1C processing as an alternative to reading multiple ancillary files. The implementation leverages SPICE kernels and includes necessary geometry transformations for heliocentric frame calculations.

Key Changes:

  • New module make_helio_index_maps.py for generating index maps dynamically using SPICE
  • Refactored helio pset calculations to use generated index maps instead of ancillary files
  • Enhanced support for energy-dependent scattering rejection and index tables

Reviewed changes

Copilot reviewed 18 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
make_helio_index_maps.py New module implementing HEALPix index map generation with spacecraft velocity aberration and SPICE integration
helio_pset.py Integrated on-the-fly index map generation, removed get_helio_adjusted_data call
l1c_lookup_utils.py Enhanced to handle energy-dependent index tables, transposed array dimensions for consistency
ultra_l1c_pset_bins.py Removed get_helio_adjusted_data function, fixed energy-dependent calculations, updated return type
constants.py Added SPICE kernel paths and FOV constants for index map generation
pyproject.toml Included sim_spice_kernels directory in package
SPICE kernels Added simulation kernels (attitude, pointing, time, frames) for helio index map calculations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lacoak21 lacoak21 force-pushed the ultra_l1c_helio_index_maps branch from 7cc70e1 to 3f18d45 Compare December 16, 2025 19:19
@lacoak21 lacoak21 requested a review from greglucas December 16, 2025 21:47
Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need all of the sim_spice_kernels included in the released package because we want those sort of "frozen in time" in a sense? This means we wouldn't get any updated clock / instrument offset updates etc.

Looks good to me and I think you already discussed that with @subagonsouth so I'm fine with it all on the code front.

@lacoak21
Copy link
Contributor Author

Do we need all of the sim_spice_kernels included in the released package because we want those sort of "frozen in time" in a sense? This means we wouldn't get any updated clock / instrument offset updates etc.

Looks good to me and I think you already discussed that with @subagonsouth so I'm fine with it all on the code front.

Yes exactly we want those never to change. Unless Nick requests they do.

Copy link
Contributor

@subagonsouth subagonsouth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lacoak21 lacoak21 merged commit b29a2da into IMAP-Science-Operations-Center:dev Dec 17, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this to Done in IMAP Dec 17, 2025
@lacoak21 lacoak21 deleted the ultra_l1c_helio_index_maps branch December 17, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants