Skip to content

BUG - IDEX L2B Spin phases should use instrument spin phase instead of spacecraft spin phase #3451

Description

@aldo9253

Description of the issue

Issue 1: Use IDEX instrument spin phase instead of spacecraft spin phase

Problem

idex_l1b.get_spice_data() currently calculates spacecraft spin phase using:

get_spacecraft_spin_phase(query_met_times=met)

The expected quantity is IDEX instrument-frame spin phase

The shared SPICE utility already provides this calculation:

get_instrument_spin_phase(met, SpiceFrame.IMAP_IDEX)

Evidence

  • All 13 manually reviewed event times matched L1B records within 0.8 ms.
  • CDF phases differed from manually calculated phases by approximately 176°.
  • Applying the defined IDEX offset reduced the disagreement to 3.4–4.5° and placed every event in the same 90° bin as the manual calculation.

The remaining few-degree discrepancy should be investigated using identical spin-table, frame-kernel, and spacecraft-clock dependencies.

Recommended changes

  1. Confirm that the required quantity is IDEX instrument spin phase.
  2. Use get_instrument_spin_phase(..., SpiceFrame.IMAP_IDEX) in L1B.
  3. Update L1B and L2B metadata to identify the phase frame explicitly.
  4. Add regression tests using known event times and expected instrument phases.

Steps to reproduce the issue

No response

Expected vs Actual behavior

No response

Code Snippet (If applicable)

Code

Additional notes, affected areas, and suggested fixes

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions