I’ve had space on my mind a lot, more and more. Pam and I have this crazy idea of setting up a ground station here at the house to be able to track and listen (and talk to?!) to the dizzying array of machines and astronauts circling overhead. So, being the Code Panda, the first thing I wanted to do was get some software together to predict satellite passes. And, with my primary interest being iOS development these days, I wanted to do it in Objective-C. (And I have this very crazy idea of doing some sort of augmented reality thing were you can “see” the satellites through the mobile camera.)
I hadn’t set out to write the satellite tracking part from scratch – I’ve already done that years ago in Pascal and then C. And the orbital models that were available then have been superseded by new more powerful models. But as I surveyed the code available out there I got kinda frustrated. I know hours and days and more have been poured into reference implementations, but they, well, were written with single letter variable names and obtusely named class-less functions. It made it unlikely that a software developer (or, for that matter an astrophysics student) could pick up the code and follow it – could review it – could learn from it, improve on it or find mistakes. The C code I found really looked like a port of FORTRAN code in many ways.
And I couldn’t find any code written for Objective-C, much less one that could interact with iOS internals like NSDate or MapKit.
So… about a week ago, I got started, and now I’m proud to say I’ve just checked into GitHub a rough Alpha of an Objective-C satellite tracking library and an iOS demo app. And it has structure and clear function and variable names. And you can “read it like English” to see what the code is doing.
It is available here, and I’m going to continue to develop it (it still needs cleanup and to account for pertubations and automatically fetch ephemeris from NORAD, among other things) as I get this home ground station together and work toward a long term goal of inspiring my kids and others to look toward the heavens and appreciate what’s out there.