Skip to content

Fix glows l1b and l2 spin axis variables#3207

Merged
tmplummer merged 1 commit into
IMAP-Science-Operations-Center:devfrom
tmplummer:3204-bug---glows-l2-incorrect-range-for-spin_axis_orientation_average-longitude
May 15, 2026
Merged

Fix glows l1b and l2 spin axis variables#3207
tmplummer merged 1 commit into
IMAP-Science-Operations-Center:devfrom
tmplummer:3204-bug---glows-l2-incorrect-range-for-spin_axis_orientation_average-longitude

Conversation

@tmplummer
Copy link
Copy Markdown
Contributor

This fixes two issues identified by GLOWS:

  • Use cartesian_to_spherical instead of latitudinal in glows l1b to get… longitude range in [0, 360)
  • Fix glows L2 to use circmean and circstd when computing statistics on longitude so that wrapping is handled correctly

Closes: #3204

… longitude range in [0, 360)

Fix glows L2 to use circmean and circstd when computing statistics on longitude so that wrapping is handled correctly
@tmplummer tmplummer requested review from maxinelasp and tech3371 May 15, 2026 21:54
@tmplummer tmplummer self-assigned this May 15, 2026
@tmplummer tmplummer added this to IMAP May 15, 2026
Copy link
Copy Markdown
Contributor

@tech3371 tech3371 left a comment

Choose a reason for hiding this comment

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

one minor question. otherwise, code changes looks good to me! Thank you for helping with this one!

lon_mean = circmean(spin_axis_all_times[..., 1], low=-np.pi, high=np.pi)
lon_std = circstd(spin_axis_all_times[..., 1], low=-np.pi, high=np.pi)
# Convert to radians for use with circular statistics methods
spin_axis_all_times = np.radians(spin_axis_all_times)
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.

is converting to radian ok for other two variables that haven't changed in this work? Eg. lat_mean and lat_std

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. Just below on lines 972-973, both latitude and longitude get converted back to degrees. The scipy.circmean and scipy.circstd functions require that the inputs be in radians.

@tmplummer tmplummer merged commit 3a7f318 into IMAP-Science-Operations-Center:dev May 15, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this to Done in IMAP May 15, 2026
@tmplummer tmplummer deleted the 3204-bug---glows-l2-incorrect-range-for-spin_axis_orientation_average-longitude branch May 15, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

BUG - GLOWS L2: incorrect range for spin_axis_orientation_average longitude

2 participants