nsat / sgp4-rs

A Rust package for the SGP-4 orbital propagator.
MIT License
8 stars 2 forks source link

Idea: use `hifitime` instead of `chrono` #20

Closed ChristopherRabotin closed 1 year ago

ChristopherRabotin commented 1 year ago

Hi there!

Sorry for jumping in out of the blue: I also work in astrodynamics and, over the past few years, I've developed hifitime. It's specifically for converting between different time scales. This is quite important in cislunar and interplanetary work, which is what I focus on.

Anyway, I saw that you were using DateTime<Utc> from chrono to store the epoch of your orbital elements. I developed hifitime specifically for Nyx initially (cf. the Orbit structure), but it does everything chrono and timers do, so I've been trying to see what projects might benefit from more precision.

nick-pascucci-spire commented 1 year ago

Hey, thanks for the suggestion. While hifitime looks pretty cool, I'm not sure that there's a big win here from replacing chrono. This library is a pretty thin wrapper around the C++ implementation of sgp4, which itself is using second-level precision for storing the TLE epoch. Additionally, since the chrono types are used as part of the public interface, to drop them would be a breaking change and require a major version bump which I don't think is quite justified.

However, if someone wanted to use hifitime with this library, we could potentially add new constructors and accessor functions which use those types without dropping chrono. It wouldn't change the internal representation of any of the timing information but it may make integrations easier.

I'm happy to review a PR if that's something you, or someone else, would like to add.