Skip to content

GLOWS - adding offset#3155

Merged
laspsandoval merged 2 commits into
IMAP-Science-Operations-Center:devfrom
laspsandoval:spin_offset_correction
May 8, 2026
Merged

GLOWS - adding offset#3155
laspsandoval merged 2 commits into
IMAP-Science-Operations-Center:devfrom
laspsandoval:spin_offset_correction

Conversation

@laspsandoval

Copy link
Copy Markdown
Contributor

This pull request introduces a new spin_offset_correction parameter to the GLOWS L1B/L2 pipeline, allowing for a constant spin angle offset to be applied throughout the processing chain. This correction addresses a systematic bias observed in star positions and is now extracted from pipeline settings, propagated through the relevant data classes, and included in all calculations and tests that use the position angle. The changes also update the test suite and validation data to ensure the new parameter is correctly handled.

Pipeline parameter and data model changes:

  • Added spin_offset_correction as a new float parameter to the PipelineSettings class, updated its extraction from the pipeline dataset, and documented its purpose. [1] [2] [3]
  • Updated the L1B and L2 data models to propagate and use spin_offset_correction in position angle calculations, including passing it to update_spice_parameters and compute_position_angle. [1] [2] [3] [4] [5] [6]

Algorithm and calculation updates:

  • Modified the calculation of look vectors and position angles to include the spin offset correction, ensuring all downstream computations reflect the correction. [1] [2]

Test and validation updates:

  • Updated test fixtures and mocks to include and handle the new spin_offset_correction parameter, and added assertions to validate its effect. [1] [2] [3] [4]
  • Added and updated validation pipeline settings JSON to include the new parameter.

These changes ensure that the spin angle offset correction is consistently applied throughout the GLOWS pipeline, improving the accuracy of star position determination.

@laspsandoval laspsandoval self-assigned this May 7, 2026
@laspsandoval laspsandoval added the Ins: GLOWS Related to the GLOWS instrument label May 7, 2026
@laspsandoval laspsandoval added this to IMAP May 7, 2026
@laspsandoval laspsandoval linked an issue May 7, 2026 that may be closed by this pull request
@laspsandoval laspsandoval requested a review from maxinelasp May 7, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GLOWS pipeline setting (spin_offset_correction) and propagates it through L1B/L2 processing so a constant spin-angle offset is applied consistently in position-angle-related calculations.

Changes:

  • Introduces spin_offset_correction in PipelineSettings and extracts it from the pipeline settings dataset.
  • Applies the correction in L1B SPICE-derived position-angle offset and in L2 mounting-based position angle computation.
  • Updates/extends tests and validation settings data to include and verify the new parameter.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
imap_processing/glows/l1b/glows_l1b_data.py Adds spin_offset_correction to settings extraction and threads it into update_spice_parameters().
imap_processing/glows/l2/glows_l2_data.py Applies spin_offset_correction when computing the mounting-based position angle used by L2.
imap_processing/tests/glows/conftest.py Updates mock pipeline settings dataset to include spin_offset_correction.
imap_processing/tests/glows/test_glows_l1b_data.py Adds assertion that spin_offset_correction shifts position_angle_offset_average.
imap_processing/tests/glows/test_glows_l2_data.py Adds test ensuring spin_offset_correction shifts the computed position angle.
imap_processing/tests/glows/validation_data/imap_glows_pipeline-settings_20251112_v001.json Adds validation pipeline settings JSON including spin_offset_correction.

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

Comment on lines +947 to +949
self.position_angle_offset_average = np.double(angle_offset) + np.double(
spin_offset_correction
)
@laspsandoval laspsandoval requested review from lacoak21 and tech3371 May 8, 2026 14:40

@tech3371 tech3371 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code changes looks good!

@laspsandoval laspsandoval merged commit 8ce46ca into IMAP-Science-Operations-Center:dev May 8, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this to Done in IMAP May 8, 2026
@laspsandoval laspsandoval deleted the spin_offset_correction branch May 8, 2026 14:54

@tmplummer tmplummer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Just the one comment about sign confusion. Nice test coverage!

# doesn't move from the SPICE determined mounting angle.
glows_mounting_azimuth, _ = get_instrument_mounting_az_el(SpiceFrame.IMAP_GLOWS)
return (360.0 - glows_mounting_azimuth) % 360.0
return (360.0 - glows_mounting_azimuth + spin_offset_correction) % 360.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am getting a bit confused by the signs in different places that spin_offset_correction is used. Earlier it was subtracted in the equation: azimuth = imap_spin_angle_bin_cntr - (angle_offset + spin_offset_correction) + 360.0 and here, I think that it is maybe being subtracted, but it is unclear. Is the equation position_angle = (360 - (glows_mounting_azimuth - spin_offset_correction)) % 360.0?

Maybe just some comments about the signs would be helpful?

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

Labels

Ins: GLOWS Related to the GLOWS instrument

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

GLOWS: add spin offset correction for L1b and L2

4 participants