Skip to content

Fix GLOWS L3a and L3b variable dimension sizing with fill padding - #167

Open
leowerneck wants to merge 2 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:lw/issue158
Open

Fix GLOWS L3a and L3b variable dimension sizing with fill padding#167
leowerneck wants to merge 2 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:lw/issue158

Conversation

@leowerneck

Copy link
Copy Markdown
Collaborator

Change Summary

Closes #158

Overview

Fixes inconsistent GLOWS L3a and L3b CDF dimensions by padding L3a spin-angle variables to 90 bins and L3b used_l3a to 50 entries. Padding is removed when L3a files are read for downstream processing.

File Changes

  • Added L3a lightcurve padding using the appropriate floating-point and raw-histogram fill values.
  • Trimmed padded L3a arrays using the valid bin count when converting CDF data for L3b processing.
  • Padded L3b used_l3a with empty strings.
  • Updated unit tests to verify fixed dimensions and fill values.

Testing

Ran 15 focused GLOWS L3a/L3b tests successfully, including model creation, CDF conversion, and processor behavior.

@leowerneck
leowerneck requested a review from jtniehof August 19, 2026 20:45
@leowerneck leowerneck self-assigned this Aug 19, 2026
@leowerneck leowerneck added the Data Release 2 Deadline: September 1, 2026 label Aug 19, 2026
@leowerneck
leowerneck requested a balanced review from Copilot August 19, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes GLOWS CDF dimension consistency by padding L3a and L3b variable-length arrays while trimming L3a padding during downstream reads.

Changes:

  • Pads L3a lightcurve arrays to 90 bins with type-appropriate fill values.
  • Pads L3b used_l3a to 50 entries.
  • Updates tests for fixed dimensions and padding values.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
imap_l3_processing/glows/l3a/utils.py Adds L3a padding and downstream trimming.
imap_l3_processing/glows/l3bc/models.py Pads and bounds L3b used_l3a.
tests/glows/l3a/test_utils.py Verifies L3a dimensions and fill values.
tests/glows/l3bc/test_models.py Verifies L3b filename padding.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@leowerneck leowerneck added Ins: GLOWS Related to the GLOWS instrument bug Something isn't working labels Aug 19, 2026
Comment thread imap_l3_processing/glows/l3a/utils.py Outdated
RAW_HISTOGRAM_FILL_VALUE = np.iinfo(np.uint32).max


def _pad_lightcurve(values, fill_value=FLOAT_FILL_VALUE) -> np.ndarray:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is logic downstream that converts np.nan and masked arrays to the correct fill value. Can this function be rewritten to utilize masked arrays for integer type data and np.nans for float type data?

  • Sebastian and Karn

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@pleasant-menlo Good catch, thank you for pointing this out! Could you please review the latest commit?

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

Labels

bug Something isn't working Data Release 2 Deadline: September 1, 2026 Ins: GLOWS Related to the GLOWS instrument

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG - GLOWS L3a, L3b inconsistent dimension sizing

3 participants