Skip to content

BUG - CoDICE Lo L2 sw species time bins not contiguous #2923

@jtniehof

Description

@jtniehof

Description of the issue

The time bins for the l2_lo-sw-species product are not contiguous: sometimes overlapping, sometimes with gaps, by about a millisecond. This is probably not critical unless it might be a symptom of something else in time calculations. Even if this impacts spin phase calculations, that's an arcminute or two. It happened to show up a bug in CAVA (IMAP-Science-Operations-Center/imap_L3_processing#68), but that has been fixed.

Steps to reproduce the issue

Compare the edges of the time bins calculated by time_0 + epoch_plus_0 to time_1 - epoch_plus_1 ... i.e., the implied end time of sample 0 to the start time of sample 1:

import numpy
import spacepy.pycdf

with spacepy.pycdf.CDF('imap_codice_l2_lo-sw-species_20260121_v005.cdf') as f:
    epoch = f.raw_var('epoch')[...]
    de_m = f['epoch_delta_minus'][...]
    de_p = f['epoch_delta_plus'][...]
edges1 = epoch + de_p
edges2 = epoch - de_m
diffs = (edges2[1:] - edges1[:-1]) / 1e6  # to ms
print(numpy.min(diffs))
print(numpy.max(diffs))
print(numpy.median(numpy.abs(diffs)))

Expected vs Actual behavior

If times were contiguous, these should be the same. If there were some gaps between samples (deadtime of some sort), the difference would always be positive. Instead, the difference is negative about 2/3 of the time, around a millisecond

Code Snippet (If applicable)

Code

Additional notes, affected areas, and suggested fixes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ins: CoDICERelated to the CoDICE instrumentbugSomething isn't working

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions