ULTRA l2 fix rectangular map ancillary products#3082
Merged
lacoak21 merged 5 commits intoIMAP-Science-Operations-Center:devfrom Apr 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 abuild_rectangular_mapmode. - 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_structurein-place (via.extend(...)and later overwriting the lists). This is risky because the module-levelDEFAULT_ULTRA_L2_MAP_STRUCTUREcan be mutated across calls, andultra_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.
tmplummer
approved these changes
Apr 28, 2026
Contributor
tmplummer
left a comment
There was a problem hiding this comment.
This all looks good and makes sense to me.
b34c242
into
IMAP-Science-Operations-Center:dev
14 checks passed
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
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
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
Testing
Update ultra l2 tests