Skip to content

Glows l2 spin angle#2852

Merged
maxinelasp merged 5 commits intoIMAP-Science-Operations-Center:devfrom
maxinelasp:glows-l2-spin-angle
Mar 24, 2026
Merged

Glows l2 spin angle#2852
maxinelasp merged 5 commits intoIMAP-Science-Operations-Center:devfrom
maxinelasp:glows-l2-spin-angle

Conversation

@maxinelasp
Copy link
Contributor

Overview

Implements spin angle and position angle offset calculations in the GLOWS L2 histogram processing pipeline. The IMAP spin angle (ψ) stored at L1B is converted to the GLOWS position angle (ψPA, Eq. 29 of the algorithm document), which measures rotation from the northernmost point of the GLOWS scanning circle. All bin-dimensioned lightcurve arrays are rolled so that bin 0 corresponds to the northernmost point.

This also includes some fixes for bin number management.

File changes

  • glows/l2/glows_l2_data.py: Adds compute_position_angle() to HistogramL2, which implements Eq. 30 (ψG,eff = (360 − ψGLOWS) % 360) using the GLOWS boresight azimuth from the SPICE frames kernel. Updates DailyLightcurve to accept position_angle as an InitVar, apply the ψ → ψPA conversion (Eq. 29), and roll all bin arrays to north-first order. Corrects position_angle_offset_average and position_angle_offset_std_dev to scalar values (one per L2 file, not per L1B block), consistent with the algorithm document's statement that std_dev is always zero and the offset is a fixed instrument property.

  • glows/l2/glows_l2.py: Minor fixes carried in from prior work — uses GlowsConstants.STANDARD_BIN_COUNT for the bins coordinate and pads bin arrays to standard length with CDF FILLVALs before writing to the output dataset.

Some comments and unit tests were updated with Claude. The unit tests were generated against the validation code provided by GLOWS.

Testing
3 new unit tests added for spin angle and position angle behavior: test_spin_angle_offset_formula, test_spin_angle_starts_at_minimum, and test_compute_position_angle. 1 existing test (test_position_angle_offset_average) updated to reflect the corrected scalar type. Other tests updated to fix SPICE issues.

Completes #2720 and #2719

@maxinelasp maxinelasp added this to the March 2026 milestone Mar 18, 2026
@maxinelasp maxinelasp self-assigned this Mar 18, 2026
Copy link
Collaborator

@vmartinez-cu vmartinez-cu left a comment

Choose a reason for hiding this comment

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

Nice job! Some of this will be helpful for the ticket I'm working on

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.

A couple of suggestions, but looks good to me.

@maxinelasp maxinelasp merged commit 0fce0fb into IMAP-Science-Operations-Center:dev Mar 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants