Skip to content

Hifitime

Nyx Space and Rust Power Firefly's Blue Ghost Lunar Landing

On March 2, 2025, Firefly Aerospace will attempt to land its Blue Ghost 1 spacecraft on Mare Crisium, a vast lunar plain on the Moon. This historic mission, which you can follow via live stream on YouTube or through official updates, is powered in part by Rust—specifically, by the open-source Nyx Space libraries: Nyx, ANISE, and Hifitime.

These libraries form the backbone of the mission's flight dynamics toolset. Here’s how they’re helping guide Blue Ghost to its lunar destination.

Nyx Space libraries are open source: Nyx under AGPL 3.0 and ANISE/Hifitime under MPL 2.0. By releasing these tools publicly, we aim to empower engineers across industries—from aerospace startups to academic researchers—to build robust solutions to challenging problems. Astrodynamics is hard enough as it is, use Nyx Space instead of reinventing the wheel.


ANISE: Precise Trajectory Computations

Since the 1980s, NASA's SPICE toolkit has been essential for interplanetary missions. ANISE builds upon this legacy as a modern, fully-featured rewrite in Rust. It introduces significant enhancements, including azimuth, elevation, and range (AER) computations, safe multi-threading, and Python bindings via PyO3.

For Blue Ghost, ANISE generates data products for all subsystems from the trajectory files provided by the flight dynamics team (FDO). Its accuracy has already been proven: ANISE correctly predicted the spacecraft's first eclipse to within one second of when it actually occurred—a testament to its precision.


Hifitime: Synchronizing Ground and Space

Executing maneuvers with sub-second precision is critical for mission success. The FDO team—led by Chris Rabotin—requires that maneuvers occur within 100 milliseconds of their planned time; any deviation means that the gravitational acceleration from celestial objects like the Earth or Moon are different relative to the expectations during the maneuver planning.

Hifitime ensures this precision by handling time scale conversions between Ephemeris Time (ET), used in trajectory data for its consistency in cislunar space, and UTC, which governs ground systems. ANISE complements this by calculating light-time delays between Blue Ghost and ground stations while accounting for relativistic effects such as aberration. Together, these tools ensure flawless timing synchronization between Earth and space.


Nyx: High-Fidelity Orbit Determination

Above GPS altitudes, spacecraft cannot rely on satellite navigation. Instead, they depend on ground-based tracking data processed through orbit determination algorithms. Nyx excels in this domain.

Nyx is a high-performance library for spaceflight dynamics that incorporates advanced models such as non-spherical gravity fields and solar radiation pressure. It directly ingests CCSDS TDM —the standard format for spacecraft tracking data—and processes it using its Kalman filter for high-fidelity orbit determination. This capability had previously been validated in real-world scenarios like the Lunar Reconnaissance Orbiter example.


If you've read this far, let's chat!

Hifitime version 4.0.0: A Leap Forward in Time Management

Months of meticulous development and rigorous testing culminate in version 4.0.0 of Hifitime, a reference time management library for engineering and scientific applications.

Hifitime inherently supports leap seconds, time scales, Julian dates, and lots more, while guaranteeing exactly one nanosecond accuracy for over 65 thousand years. Hifitime plans lunar missions via ANISE, flies onboard various spacecraft, coordinates satellite communications, and is used in exciting research on global navigation satellite systems like GPS and Galileo.

For those eager to dive into the technical details, you can find the Rust user guide here and the Python user guide here.

Github

Key improvements

One of the most significant changes in version 4.0.0 is how Epochs handle time scales. Epochs now retain their original time scales, simplifying conversions and ensuring that computations remain accurate without introducing single-digit nanosecond rounding errors. Special thanks to Guillaume for his dedicated work on this enhancement.

This change implies that the duration between two epochs is consistent with their time scale if both are in the same time scale. For example, the time difference over a leap second when both epochs are in UTC is a single second, instead of two seconds in version 3. The behavior from version 3 now requires converting one or both epochs to a leap-second free time scale.

Another notable change is in the serialization of durations. Previously, a 200-nanosecond duration was represented in JSON as {"centuries": 0, "nanoseconds": 200}. Now, it is serialized directly as 200 ns, its representation in the Système International (SI). The largest unit in this new serialization format is days, so a duration of 1.23456789 centuries will be serialized as 45092 days 14 h 12 min 44 s 546 ms 399 μs 744 ns.

Epochs are now nominally printed in their Gregorian representation in their respective time scale, whereas the debug printing (or __repr__ in Python) will print them in UTC.

Python users may now use todatetime and fromdatetime to convert a Hifitime epoch into a Python datetime object.

Bug fixes

In previous versions, representing date times in the Gregorian format required complex calculations that were prone to errors, especially for dates before 1800. Version 4 simplifies these computations, eliminating known bugs. Hifitime uses a consistent Gregorian calendar representation, avoiding any discrepancies from historical calendar transitions.

License change

Following an open period for community feedback that began earlier this year, Hifitime version 4 is now licensed under the Mozilla Public License version 2.0. This change reflects the project's commitment to open-source principles and community collaboration.

What's next for Hifitime?

Looking ahead, Version 4.1 is set to introduce several new time scales, including the recently drafted Lunar Coordinate Time. Special thanks to J-M for providing the specifications that make this possible.

Hifitime version 5 is also on the horizon. This upcoming release aims to enhance precision by extending the representation of durations from nanoseconds down to zeptoseconds, or twelve orders of magnitude smaller than one nanosecond. Additionally, plans to streamline the library by removing cumbersome initializers have been deferred to this major release.

With these updates, Hifitime continues to set the standard for precision time management in scientific and engineering contexts. Whether you're navigating lunar missions or synchronizing satellite communications, Hifitime version 4.0.0 offers unparalleled accuracy and reliability.

blog-post-image