Add the Iqbal positioning algorithm - #118
Merged
Merged
Conversation
Ports the Iqbal implementation to the type generic architecture with the solposx operation order, unit_clamp on the zenith argument, and azimuth normalized to [0, 360). The enabled reference test matches the exact solposx table to 2.8e-14 degrees, five orders inside the 1e-10 tolerance the other algorithms use. Measured precision entries: 2.2e-5 degrees at Float32, 2.1e-14 at Float64, 3.1e-32 at Float128, which works here because Iqbal never feeds large angles into degree trig. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg3j4XXUooMvDgUpRajxTq
test_algorithms() in expected-values.jl replaces the per file lists, so a new algorithm registers everywhere in one place. This also widens coverage: the interface tests previously skipped USNO and the refraction interface tests skipped SPA. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg3j4XXUooMvDgUpRajxTq
Adds the Iqbal row, short sections on the Interpolated wrapper and automatic differentiation with pointers to their guides, an Interpolations row in the extensions table, and condenses the numeric precision section to a summary near the end, with the full measured table living in the precision guide. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg3j4XXUooMvDgUpRajxTq
Contributor
Benchmark Results (Julia vlts)Time benchmarks
Memory benchmarks
|
The positioning page cites Iqb83 and Spe71, which were missing from refs.bib and failed the docs build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg3j4XXUooMvDgUpRajxTq
Contributor
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
Contributor
Benchmark Results (Julia vpre)Time benchmarks
Memory benchmarks
|
Iqbal joins the AirspeedVelocity position suite, the solposx reference benchmarks, and the accuracy comparison in the benchmarking guide. The Interpolated wrapper joins the speed suite with a span covering the largest vector case, and stays out of the accuracy figures because its error against the SPA reference is only around 1e-10 degrees. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg3j4XXUooMvDgUpRajxTq
expected_iqbal moves into expected-values.jl because the extensions tests run before the positioning tests and referenced it too early, which failed CI on every LTS job. The refraction test list is renamed to avoid colliding with the new test_algorithms helper. The benchmarking guide figures derive their axis ranges from the algorithm list instead of a hardcoded four, and the color sets gain an Iqbal entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg3j4XXUooMvDgUpRajxTq
The throughput and speedup barplots still hardcoded five tick values, which Makie rejects with six algorithms. The full docs build now passes end to end. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg3j4XXUooMvDgUpRajxTq
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 20 +1
Lines 735 751 +16
=========================================
+ Hits 735 751 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Iqbal solar position algorithm: declination and equation of time from a truncated Fourier series in the day angle (Iqbal 1983, building on Spencer 1971), zenith and azimuth from the standard spherical trigonometry relations, no refraction by default.
T <: Real, magnitude safefractional_hour(T, dt),unit_clampon the zenith argument, azimuth normalized to [0°, 360°), and solposx's exact operation order so the reference comparison is artifact free. Zero allocations,@inferredclean.atol = 1e-10. Measured against a 256 bit BigFloat reference over the standard date/latitude grid: 2.2e-5° atFloat32, 2.1e-14° atFloat64, 3.1e-32° atFloat128. NotablyFloat128works here, unlike NOAA and USNO, because Iqbal never feeds large unreduced angles into degree trigonometry.test_algorithms()helper inexpected-values.jl, so a new algorithm registers in the interface, type stability, precision, autodiff, and MTK suites in one place. This also widens coverage that the old lists silently skipped (USNO in the interface tests, SPA in the refraction interface tests).Interpolatedwrapper and automatic differentiation with guide links, the previously missing Interpolations row in the extensions table, and the numeric precision section condensed and moved down, with the full measured table living in the precision guide.Test plan
test-iqbal.jlenabled against the exact solposx references atatol = 1e-10Pkg.test()green locally (including Aqua and JET)🤖 Generated with Claude Code