Skip to content

BUG - GLOWS L1B passes time "0.0" to get instrument spin phase #3007

@vmartinez-cu

Description

@vmartinez-cu

Description of the issue

Failed processing jobs show that an imap_start_time of 0.0 is being passed into the get_instrument_spin_phase function called by the update_spice_parameters method in glows_l1b_data.py. A time of zero corresponds to '2010-01-01T00:00:00.000' which is invalid and not covered by spin data.

See processing job for 2026-01-27T00:00:00 for logged error details. Below is a snippet of that log

  File "<string>", line 20, in __init__
  File "/usr/local/lib/python3.12/site-packages/imap_processing/glows/l1b/glows_l1b_data.py", line 850, in __post_init__
    self.update_spice_parameters()
  File "/usr/local/lib/python3.12/site-packages/imap_processing/glows/l1b/glows_l1b_data.py", line 924, in update_spice_parameters
    get_instrument_spin_phase(
  File "/usr/local/lib/python3.12/site-packages/imap_processing/spice/spin.py", line 346, in get_instrument_spin_phase
    spacecraft_spin_phase = get_spacecraft_spin_phase(query_met_times)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/imap_processing/spice/spin.py", line 317, in get_spacecraft_spin_phase
    spin_df = interpolate_spin_data(query_met_times)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/imap_processing/spice/spin.py", line 191, in interpolate_spin_data
    raise ValueError(
ValueError: Query times, [0.] are outside of the spin data range, (np.float64(507134250.339427), np.float64(507399737.970175)).

This might be related to issue #2691 and #2906

Steps to reproduce the issue

The following cli command in prod results in this error:

imap_cli --instrument glows --data-level l1b --descriptor hist --start-date 20260127 --version v001 --dependency imap_glows_l1b_hist-d0e4c22f_20260127-repoint00139_v001.json --repointing repoint00139

Local testing with print statements show that valid times are used at first and eventually a time of 0.0 is passed in and breaks l1b processing

Code Snippet (If applicable)

Within the update_spice_parameters() method in the glows_l1b_data.HistogramL1B class, the following lines of code is where the failure occurs because self.imap_start_date = 0.0

        angle_offset = 360 - get_spin_angle(
            get_instrument_spin_phase(
                self.imap_start_time, instrument=geometry.SpiceFrame.IMAP_GLOWS
            ),
            degrees=True,
        )

Metadata

Metadata

Assignees

Labels

Ins: GLOWSRelated to the GLOWS instrumentLevel: L1Level 1 processingbugSomething isn't working

Type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions