Add azimuth and lunar phase computations, enhance target handling#3
Open
Add azimuth and lunar phase computations, enhance target handling#3
Conversation
- Introduced azimuth computations for Sun, Moon, stars, and ICRS directions in `azimuth.hpp`. - Added lunar phase geometry and events handling in `lunar_phase.hpp`. - Implemented a `Target` class for fixed ICRS pointing with altitude and azimuth computations. - Updated `siderust.hpp` to include new headers for azimuth and lunar phase functionalities. - Modified `spherical.hpp` to correct azimuth and polar coordinate handling. - Enhanced time handling in `time.hpp` to support quantity-based arithmetic. - Updated tests to reflect changes in period handling and quantity usage.
added 17 commits
February 24, 2026 23:48
- Updated mainpage.md to include new features: azimuth calculations, target tracking, and lunar phase events. - Refined README.md in examples directory to reflect new build instructions and added examples. - Expanded altitude_events_example.cpp to demonstrate altitude and azimuth calculations for multiple celestial bodies. - Introduced azimuth_lunar_phase_example.cpp to showcase azimuth events and lunar phase geometry. - Improved coordinate_systems_example.cpp with compile-time frame transformations and observer details. - Enhanced coordinates_examples.cpp with detailed typed-coordinate construction and conversion examples. - Revamped demo.cpp for a comprehensive end-to-end demonstration of siderust capabilities. - Updated solar_system_bodies_example.cpp to include body dispatch API and ephemeris calculations. - Added trackable_targets_example.cpp to illustrate polymorphic tracking of celestial targets.
…nd in altitude events example
- Removed redundant functions for crossing direction and moon phase label names, replacing them with direct usage of enum values. - Updated output formatting in demo and example files to utilize operator overloads for cleaner code. - Introduced stream operators for various classes including AzimuthExtremumKind, Position, Geodetic, Direction, and lunar phase enums for improved output readability. - Enhanced Target class to support strongly-typed celestial directions, ensuring automatic conversion to ICRS where necessary. - Added tests for new Target functionality, verifying altitude calculations and typed accessors for ICRSTarget and EclipticMeanJ2000Target. - Updated coordinate tests to use qtty::Degree for consistency and clarity in direction initialization.
- Adjusted formatting in test files to improve readability by aligning code and comments. - Replaced multiple lines of code with more concise versions in tests for TypedCoordinates, Ephemeris, Observatories, and Time. - Ensured consistent use of spacing and indentation across all test cases. - Verified that all assertions and static assertions maintain their intended functionality.
- Implemented body-centric coordinate transformations in `bodycentric_transforms.hpp`. - Introduced `BodycentricPos` template struct for handling body-centric positions. - Added `to_bodycentric` function to convert geocentric/heliocentric positions to body-centric coordinates. - Created `BodycentricParams` struct to encapsulate orbital parameters and reference centers. - Added Mars heliocentric position calculation in `ephemeris.hpp`. - Developed a new example `l2_satellite_mars_example.cpp` demonstrating Mars's position as seen from a JWST-like L2 orbit. - Enhanced `Position` class in `cartesian.hpp` with distance calculation methods. - Added unit tests in `test_bodycentric.cpp` to validate body-centric transformations and Keplerian position calculations.
…ses, and trackable targets - Implemented `17_serde_serialization.cpp` to demonstrate manual JSON serialization for siderust types. - Added `18_kepler_orbit.cpp` to showcase Keplerian orbit propagation with a manual solver. - Created `19_brent_root_finding.cpp` to illustrate a manual implementation of Brent's root-finding method. - Developed `20_moon_phase.cpp` to demonstrate lunar phase calculations and event searches. - Introduced `21_trackable_demo.cpp` to showcase polymorphism in handling various astronomical targets. Updated headers to include new position conversion methods between Cartesian and spherical coordinates.
… in coordinate classes
…sformation functionalities - Deleted several example files including bodycentric_coordinates.cpp, coordinate_systems_example.cpp, coordinates_examples.cpp, demo.cpp, l2_satellite_mars_example.cpp, solar_system_bodies_example.cpp, and trackable_targets_example.cpp to streamline the codebase. - Added a new function `in_azimuth_range` to find periods when a star's azimuth is within a specified range. - Introduced new methods in the `Position` class for transforming positions to different reference centers and combined frame + center transformations. - Added a new type alias `HCRS` for Heliocentric positions in the equatorial frame. - Implemented a new function `mars_barycentric` to retrieve Mars's barycentric position using VSOP87. - Updated submodules for qtty-cpp, siderust, and tempoch-cpp to their latest commits.
…ality - Converted Rust serialization examples to C++ in `11_serde_serialization.cpp`, demonstrating manual JSON-like serialization for time, coordinate, body-related, and target objects. - Added file I/O capabilities to save and load serialized data. - Introduced new functions in `ephemeris.hpp` for calculating heliocentric and barycentric positions of Mercury, Venus, Jupiter, Saturn, Uranus, and Neptune using VSOP87. - Expanded time-related types in `time.hpp` to include TDB, TT, TAI, TCG, TCB, GPS, UT, UniversalTime, JDE, and UnixTime. - Updated submodules for siderust and tempoch-cpp to the latest commits.
- Introduced a unified Subject type to represent any celestial entity, allowing for simplified function calls for altitude, azimuth, and other calculations. - Updated existing celestial body and star references to use the new Subject API. - Added tests for the Subject API covering various celestial entities including bodies, stars, and ICRS directions. - Refactored existing tests to accommodate changes in how celestial bodies and stars are accessed. - Updated CMakeLists.txt to include the new test file for Subject.
…proved functionality
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.
azimuth.hpp.lunar_phase.hpp.Targetclass for fixed ICRS pointing with altitude and azimuth computations.siderust.hppto include new headers for azimuth and lunar phase functionalities.spherical.hppto correct azimuth and polar coordinate handling.time.hppto support quantity-based arithmetic.