GLOWS - adding offset#3155
Conversation
There was a problem hiding this comment.
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_correctioninPipelineSettingsand 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.
| self.position_angle_offset_average = np.double(angle_offset) + np.double( | ||
| spin_offset_correction | ||
| ) |
tech3371
left a comment
There was a problem hiding this comment.
The code changes looks good!
8ce46ca
into
IMAP-Science-Operations-Center:dev
tmplummer
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
This pull request introduces a new
spin_offset_correctionparameter 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:
spin_offset_correctionas a new float parameter to thePipelineSettingsclass, updated its extraction from the pipeline dataset, and documented its purpose. [1] [2] [3]spin_offset_correctionin position angle calculations, including passing it toupdate_spice_parametersandcompute_position_angle. [1] [2] [3] [4] [5] [6]Algorithm and calculation updates:
Test and validation updates:
spin_offset_correctionparameter, and added assertions to validate its effect. [1] [2] [3] [4]These changes ensure that the spin angle offset correction is consistently applied throughout the GLOWS pipeline, improving the accuracy of star position determination.