Skip to content

Fix problems with time order of ephemeris data#285

Merged
taldcroft merged 4 commits intomasterfrom
fix-cheta-sync-ephem-order
Jan 5, 2026
Merged

Fix problems with time order of ephemeris data#285
taldcroft merged 4 commits intomasterfrom
fix-cheta-sync-ephem-order

Conversation

@taldcroft
Copy link
Member

@taldcroft taldcroft commented Dec 1, 2025

Description

This fixes an issue that full-resolution ephemeris data from a cheta-sync maintained archive include data that are both duplicated and not in strict time order.

The raw ephemeris HDF5 archive files are non-monotonic because the archive FITS files are overlapping and have duplicate times. Typically new ephemeris files come out each 7 days and cover many weeks of data (e.g. about 10 weeks for the predictive EPHEM 0 files.

The HDF5 files on HEAD have TIME.quality set to bad for the duplicate times, so this code is not strictly required there. But for archives maintained with cheta_sync, the quality codes are not back-updated when new data appear, causing problems.

Fixes #245

Requires

None, but this should be considered as a required dependency for sot/xija#150.

cc: @matthewdahmer @christian-anderson @jzuhone

Interface impacts

None

Testing

Unit tests

  • Mac

Independent check of unit tests by Jean

  • Mac
(latest) flame:cheta jean$ pytest
============================================================================= test session starts ==============================================================================
platform darwin -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/jean/git
configfile: pytest.ini
plugins: anyio-4.7.0, timeout-2.3.1
collected 194 items                                                                                                                                                            

cheta/tests/test_comps.py ..............s.......................................................                                                                         [ 36%]
cheta/tests/test_data_source.py ...........                                                                                                                              [ 41%]
cheta/tests/test_fetch.py ........................................                                                                                                       [ 62%]
cheta/tests/test_intervals.py .........................                                                                                                                  [ 75%]
cheta/tests/test_orbit.py .                                                                                                                                              [ 75%]
cheta/tests/test_remote_access.py ......                                                                                                                                 [ 78%]
cheta/tests/test_sync.py ........                                                                                                                                        [ 82%]
cheta/tests/test_units.py ...........                                                                                                                                    [ 88%]
cheta/tests/test_units_reversed.py ...........                                                                                                                           [ 94%]
cheta/tests/test_utils.py ...........                                                                                                                                    [100%]

=============================================================================== warnings summary ===============================================================================
cheta/cheta/tests/test_comps.py: 14 warnings
  /Users/jean/miniforge3/envs/latest/lib/python3.12/site-packages/bs4/builder/_lxml.py:124: DeprecationWarning: The 'strip_cdata' option of HTMLParser() has never done anything and will eventually be removed.
    parser = parser(

cheta/cheta/tests/test_comps.py::test_cmd_states
  /Users/jean/miniforge3/envs/latest/lib/python3.12/site-packages/setuptools_scm/git.py:312: UserWarning: git archive did not support describe output
    warnings.warn("git archive did not support describe output")

cheta/cheta/tests/test_intervals.py::test_fetch_MSID_intervals
  /Users/jean/miniforge3/envs/latest/lib/python3.12/site-packages/django/utils/encoding.py:266: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
    encoding = locale.getdefaultlocale()[1] or 'ascii'

cheta/cheta/tests/test_intervals.py::test_fetch_MSID_intervals
  /Users/jean/miniforge3/envs/latest/lib/python3.12/site-packages/django/http/request.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================== 193 passed, 1 skipped, 17 warnings in 209.95s (0:03:29) ============================================================
(latest) flame:cheta jean$ git rev-parse HEAD
2008454e7f878f1deb91ac03326450e45b3aef3c

Functional tests

Additional functional testing in the included notebook.

@taldcroft taldcroft requested a review from jeanconn January 5, 2026 20:30
@taldcroft taldcroft merged commit 532885b into master Jan 5, 2026
2 checks passed
@taldcroft taldcroft deleted the fix-cheta-sync-ephem-order branch January 5, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure that ephemeris data are accurate

2 participants