Skip to content

global ephemeris data cache #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicHoch
Copy link
Contributor

@nicHoch nicHoch commented Apr 10, 2025

add a internal ephemeris data cache. This allows to save hidden fido search and download of the same data multiple times

All coordinate transform and imaging methods might internally search for correct ephemeris data for higher precession.
To get the ephemeris data a FIDO search (defaults to our stix data server) is uses and data gets downloaded.

The ephemeris data search utilises a global cache in order to avoid unnecessary network traffic or file loading. ANC ephemeris fits files are organised as daily files. The entire day is put to cache if touched once.

A user can prefetch or pinpoint specific ephemeris data files with the `load_ephemeris_fits_to_cache(filename)' method.

    from stixpy.coordinates.transforms import load_ephemeris_fits_to_cache

    start_time = Time("2023-01-01T12:00:00")
    end_time = Time("2023-01-01T12:30:00")
    query = Fido.search(
        a.Time(start_time, end_time),
        a.Instrument.stix,
        a.Level.anc,
        a.stix.DataType.asp,
        a.stix.DataProduct.asp_ephemeris,
    )

    aux_files = Fido.fetch(query["stix"])
    for file in aux_files:
        load_ephemeris_fits_to_cache(file)

…search and download of the same data multiple times
@nicHoch nicHoch self-assigned this Apr 10, 2025
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 92.64706% with 10 lines in your changes missing coverage. Please review.

Project coverage is 76.21%. Comparing base (f6b4a88) to head (d49769b).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
stixpy/product/sources/anc.py 87.09% 4 Missing ⚠️
stixpy/coordinates/transforms.py 92.85% 3 Missing ⚠️
stixpy/utils/table_lru.py 94.73% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #165      +/-   ##
==========================================
+ Coverage   75.50%   76.21%   +0.70%     
==========================================
  Files          32       35       +3     
  Lines        2111     2224     +113     
==========================================
+ Hits         1594     1695     +101     
- Misses        517      529      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant