Skip to content

ULTRA l2 fix rectangular map ancillary products#3082

Merged
lacoak21 merged 5 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21:ultra_l2_fix_healpix_to_rectangular_conversion
Apr 30, 2026
Merged

ULTRA l2 fix rectangular map ancillary products#3082
lacoak21 merged 5 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21:ultra_l2_fix_healpix_to_rectangular_conversion

Conversation

@lacoak21
Copy link
Copy Markdown
Contributor

@lacoak21 lacoak21 commented Apr 24, 2026

Change Summary

closes #3012

Related to IMAP-Science-Operations-Center/imap_L3_processing#82

Overview

Push / pull ancillary variables to a rectangular map directly. Keep ena_instensity calculation the same.

File changes

  • imap_processing/ultra/l2/ultra_l2.py
    • Adds direct rectangular projection path for ancillary variables
    • limits recursive conversion to intensity-related variables.
  • imap_processing/tests/ultra/unit/test_ultra_l2.py
    • Adds a unit test for rectangular skymap generation
    • updates calls to the renamed skymap generator.

Testing

Update ultra l2 tests

@lacoak21 lacoak21 requested a review from Copilot April 24, 2026 20:26
@lacoak21 lacoak21 self-assigned this Apr 24, 2026
@lacoak21 lacoak21 added this to IMAP Apr 24, 2026
@lacoak21 lacoak21 added the Ins: Ultra Related to the IMAP-Ultra instrument label Apr 24, 2026
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 updates ULTRA L2 rectangular map generation so that ancillary variables are projected directly into the rectangular grid from L1C pointing sets, while ENA intensity products continue to be derived via HEALPIX-to-rectangular recursive subdivision (per issue #3012).

Changes:

  • Renames and generalizes the map builder to generate_ultra_skymap(...) with a build_rectangular_map mode.
  • For rectangular outputs, builds a direct rectangular map for ancillary variables and merges in recursively converted intensity variables only.
  • Adds a unit test covering direct rectangular map generation and updates existing tests to use the renamed function.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
imap_processing/ultra/l2/ultra_l2.py Adds direct rectangular projection path for ancillary variables; limits recursive conversion to intensity-related variables.
imap_processing/tests/ultra/unit/test_ultra_l2.py Adds a unit test for rectangular skymap generation; updates calls to the renamed skymap generator.
Comments suppressed due to low confidence (2)

imap_processing/ultra/l2/ultra_l2.py:396

  • This function mutates the caller-provided output_map_structure in-place (via .extend(...) and later overwriting the lists). This is risky because the module-level DEFAULT_ULTRA_L2_MAP_STRUCTURE can be mutated across calls, and ultra_l2() now calls this function twice for rectangular output. Prefer working on local copies (or a deep-copied map structure) to avoid cross-call side effects.
    # Add additional data variables to the map
    output_map_structure.values_to_push_project.extend(
        [
            "num_pointing_set_pixel_members",
            "obs_date_range",

imap_processing/ultra/l2/ultra_l2.py:723

  • Same issue here: assign_coords() is not in-place, so the epoch coordinate update is currently a no-op for the Healpix map as well. Assign the returned Dataset back (or set the coord directly).
    healpix_skymap.data_1d.assign_coords(
        epoch=(
            (CoordNames.TIME.value,),
            [
                pset_epochs.min(),

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

Comment thread imap_processing/ultra/l2/ultra_l2.py Outdated
Comment thread imap_processing/ultra/l2/ultra_l2.py
Comment thread imap_processing/tests/ultra/unit/test_ultra_l2.py
Comment thread imap_processing/tests/ultra/unit/test_ultra_l2.py
Comment thread imap_processing/tests/ultra/unit/test_ultra_l2.py
Comment thread imap_processing/ultra/l2/ultra_l2.py Outdated
@lacoak21 lacoak21 marked this pull request as ready for review April 28, 2026 16:01
Copy link
Copy Markdown
Contributor

@tmplummer tmplummer left a comment

Choose a reason for hiding this comment

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

This all looks good and makes sense to me.

Comment thread imap_processing/ultra/l2/ultra_l2.py Outdated
@lacoak21 lacoak21 merged commit b34c242 into IMAP-Science-Operations-Center:dev Apr 30, 2026
14 checks passed
@lacoak21 lacoak21 deleted the ultra_l2_fix_healpix_to_rectangular_conversion branch April 30, 2026 15:03
@github-project-automation github-project-automation Bot moved this to Done in IMAP Apr 30, 2026
maxinelasp pushed a commit to maxinelasp/imap_processing that referenced this pull request May 1, 2026
…ons-Center#3082)

* tests and code to correct rectangular map

* comment update

* pr comments

* pr comments

* type annotation
lacoak21 added a commit to lacoak21/imap_processing that referenced this pull request May 4, 2026
…ons-Center#3082)

* tests and code to correct rectangular map

* comment update

* pr comments

* pr comments

* type annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ins: Ultra Related to the IMAP-Ultra instrument

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ULTRA l2 rectangular map projection update

3 participants