Skip to content

Clean up sidereal time calculations.#209

Merged
attipaci merged 4 commits into
nextfrom
st-cleanup
Aug 21, 2025
Merged

Clean up sidereal time calculations.#209
attipaci merged 4 commits into
nextfrom
st-cleanup

Conversation

@attipaci

@attipaci attipaci commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator

The NOVAS_C function sirereal_time() offered two mathematically identical ways of calculating sidereal time, which differed only in that one way (the so labelled 'ERA method') perfromed the calculation in a changed coordinate basis. The library should not have two different ways for calculating the same quantity. Instead, it should offer only the canonical way. The change makes the erot argument superfluous going forward.

Additionally, the sidereal_time() function is a bit messy to use, requiring too many arguments, and returning the single decimal result in a pointer. Instead, we introduce new, functions:

  • novas_gmst(double jd_ut1, double ut1_to_tt) and
  • novas_gast(double jd_ut1, double ut1_to_tt, enum novas_accuracy accuracy)

to perform the same calculations in a simpler way.

Also, novas_make_frame() has been altered to eliminate related duplicate calculations, and instead use the frame-based quantities readily available.

@attipaci attipaci added this to the 1.5.0 milestone Aug 18, 2025
@attipaci attipaci self-assigned this Aug 18, 2025
@attipaci attipaci added the enhancement New feature or request label Aug 18, 2025
@attipaci

Copy link
Copy Markdown
Collaborator Author

It may need PR #208 to pass tests due to changes of how CIO location is calculated.

@attipaci attipaci force-pushed the st-cleanup branch 4 times, most recently from 7175fb6 to 9abf8dd Compare August 18, 2025 22:14
@codecov

codecov Bot commented Aug 18, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (next@e6f42f6). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #209   +/-   ##
=======================================
  Coverage        ?   99.91%           
=======================================
  Files           ?       23           
  Lines           ?     4518           
  Branches        ?      841           
=======================================
  Hits            ?     4514           
  Misses          ?        0           
  Partials        ?        4           
Flag Coverage Δ
unittests 99.91% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/earth.c 100.00% <100.00%> (ø)
src/equinox.c 100.00% <100.00%> (ø)
src/frames.c 99.73% <100.00%> (ø)
src/observer.c 100.00% <ø> (ø)
src/system.c 100.00% <100.00%> (ø)
src/timescale.c 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6f42f6...a6bcb3e. Read the comment docs.

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

@attipaci attipaci merged commit 4205fbf into next Aug 21, 2025
14 checks passed
@attipaci attipaci deleted the st-cleanup branch August 21, 2025 07:18
attipaci added a commit that referenced this pull request Aug 21, 2025
* Clean up sidereal time calculations.

* Disable optmized frame gcrs_to_cirs initialization

* Unneeded error checking from sidereal_time()

* API doc edits
attipaci added a commit that referenced this pull request Aug 22, 2025
* Clean up sidereal time calculations.

* Disable optmized frame gcrs_to_cirs initialization

* Unneeded error checking from sidereal_time()

* API doc edits
attipaci added a commit that referenced this pull request Aug 23, 2025
* Clean up sidereal time calculations.

* Disable optmized frame gcrs_to_cirs initialization

* Unneeded error checking from sidereal_time()

* API doc edits
attipaci added a commit that referenced this pull request Aug 24, 2025
* Clean up sidereal time calculations.

* Disable optmized frame gcrs_to_cirs initialization

* Unneeded error checking from sidereal_time()

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant