AstroZ: Astronomical and Spacecraft Toolkit

Hey just wanted to show off my project AstroZ! It’s still a work in progress, but it is far enough that I wanted to show it off. It currently supports parsing of the 2 most common data formats you’ll encounter in the spacecraft world (CCSDS for telemetry, and Vita49 for RF communications).

Recently, I added in TLE support which will allow me to begin the next phase I’m excited to build out; orbit propagation and determination which will lead into mission planning. I know this is a bit niche, but excited to be using zig in this way, and at some point i want to utilize this toolkit to build out a simulation suite


I was able to get the RK4 orbit propagation working today and I’m happy with the accuracy with fairly minimal inputs! I’m hoping to add more complex models in the future to further get orbit prop as accurate as I can.

I tested a 2 day orbit prediction using an existing real spacecrafts TLE and was very happy with the results. I am still on the lookout for a decent plotting lib for zig (LMK what is out there please!), so for now the visualization is done in python, but all the raw prop data is fed directly from zig


made a quick update that also adds in impulse maneuvers. Here is what a handful of small pulses from the “engine” does to orbit prop using the same TLE


bit better of a look with the impulse towards the end of the prop and not towards the beginning


now with phase maneuvers. This makes raising / lower orbits a breeze! No longer need 2x impulse inputs. You can just ask for a phase maneuver which will handle the rest! Useful when you are trying to meet up with another spacecraft, by raising/lowering orbit

1 Like

one of the trickier maneuver types: plane changes. Ran into a challenging bug implementing this where energy of the sc was growing exponentially while it was attempting this maneuver. In plane changes, the energy of the spacecraft should remain unchanged and the orbit should only shift velocity vector direction but not magnitude (due to orbits being a closed system). After some tweaks was able to find out what was causing the crazy energy growth and get something that looks as I would expect



now i want to start focusing on the spacecraft modeling. So the first step in that is being able to determine orientation. The code is def still a bit of a mess, and can probably be cleaned up, but my goal was to get it working and I am happy seeing the orientation showing up as I would expect


FITS File image generation was my next thing to tackle here. S/O to @tensorush for porting cfitsio to zig for me and making this a much simpler process overall.

Here is an example Hubble telescope fits image of a narrowband filter for the Pillars of Creation being parsed via AstroZ