Add #phase_angle and #illuminated_fraction to planets#200
Merged
rhannequin merged 2 commits intomainfrom Aug 9, 2025
Merged
Conversation
While generally mostly interesting for the Moon, the phase angle and illuminated fraction are two figures that can be useful for anticipating how a planet looks like. This is particularly the case for Mercury and Venus. As inferior planets (with orbits closer to the Sun than the Earth), they are never observed fully illuminated and always show a phase. For superior planets, the information is less interesting as we constantly see them almost completely illuminated. But still, the information is there. Because the phase angle depends on the vector between the sun and the observer, the sun needs to be computed for each planet instance. This isn't great, however the new feature of caching should help.
Merged
rhannequin
added a commit
that referenced
this pull request
Sep 1, 2025
## 0.8.0 - 2025-09-01 _If you are upgrading: please see [UPGRADING.md]._ ### Bug fixes * Fix UPGRADING documentation ([#178]) * Fix possible division by zero in RTS ([#185]) ### Features * Introduce performance benchmark ([#183]) * Cache positions in RTS calculator ([#182]) * Internal global LRU cache ([#186]) * Global configuration ([#187]) * Compute the constellation a body is in ([#199]) * Add `#phase_angle` and `#illuminated_fraction` to planets ([#200]) * Apparent magnitude ([#201]) * Add #events_between to TwilightCalculator with better accuracy ([#204]) * `#angular_diameter` on Solar System bodies ([#207]) * Fix constellation boundaries near 24h right ascension ([#209]) ### Improvements * Bump standard from 1.49.0 to 1.50.0 by @dependabot ([#177]) * Bump ephem from 0.3.0 to 0.4.1 by @dependabot ([#181], [#191]) * Bump irb from 1.14.3 to 1.15.2 by @dependabot ([#184]) * Bump rspec from 3.13.0 to 3.13.1 by @dependabot ([#188]) * Bump benchmark from 0.4.0 to 0.4.1 by @dependabot ([#189]) * Bump rake from 13.2.1 to 13.3.0 by @dependabot ([#190]) * Bump matrix from 0.4.2 to 0.4.3 by @dependabot ([#193]) * Update rubyzip requirement from ~> 2.3 to ~> 3.0 by @dependabot ([#194]) * Bump rubyzip from 3.0.0 to 3.0.2 by @dependabot ([#202], [#206]) * Exclude benchmarks from release ([#196]) * `Epoch` refactoring into `JulianDate` ([#197]) * Support Ruby 3.4.4 ([#198]) * Bump actions/checkout from 4 to 5 ([#203]) * Internal documentation ([#205]) ### Backward-incompatible changes * `Epoch` refactoring into `JulianDate` ([#197]) * `#angular_diameter` on Solar System bodies ([#207]) * Rename "epoch" ([#208]) ### Closed issues * Consider adding typical usage/deployment info ([#179]) * Performance degradation in v0.7 ([#180]) **Full Changelog**: v0.7.0...v0.8.0 [#177]: #177 [#178]: #178 [#179]: #179 [#180]: #180 [#181]: #181 [#182]: #182 [#183]: #183 [#184]: #184 [#185]: #185 [#186]: #186 [#187]: #187 [#188]: #188 [#189]: #189 [#190]: #190 [#191]: #191 [#193]: #193 [#194]: #194 [#196]: #196 [#197]: #197 [#198]: #198 [#199]: #199 [#200]: #200 [#201]: #201 [#202]: #202 [#203]: #203 [#204]: #204 [#205]: #205 [#206]: #206 [#207]: #207 [#208]: #208 [#209]: #209 [UPGRADING.md]: https://github.com/rhannequin/astronoby/blob/main/UPGRADING.md
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.
While generally mostly interesting for the Moon, the phase angle and illuminated fraction are two figures that can be useful for anticipating how a planet looks like.
This is particularly the case for Mercury and Venus. As inferior planets (with orbits closer to the Sun than the Earth), they are never observed fully illuminated and always show a phase.
For superior planets, the information is less interesting as we constantly see them almost completely illuminated. But still, the information is there.
Because the phase angle depends on the vector between the sun and the observer, the sun needs to be computed for each planet instance. This isn't great, however the new feature of caching should help.
#phase_anglereturns anAstronoby::Angleobject,#illuminated_fractionreturns aFloat.Because the phase angle depends on the Sun, because in Astronoby an apparent position is geocentric, is doesn't make sense for
Astronoby::SunandAstronoby::Earthto have values for these two methods. Therefore, both classes returnnilfor both methods.Values have been compared with the IMCCE, JPL Horizons and Skyfield.