Improved satellite orbits (getting SGP4 model into Celestia)
Posted: 09.03.2007, 22:04
I know that a number of people (me included) have been wanting a way to get improved satellite orbits into Celestia for a long time, using TLEs and the SGP4 model to do it. Here's an outline of how to do it, /without/ having to implement the SGP4 model in Celestia. This should work fine with any recent version of Celestia, with or without Spice. What you do need is the NAIF spice toolkit.
Note that I have not done this, I've just seen from the docs how it would work. I'm not giving a cookbook here, so you'll need to read the docs and have a clue.
1) Build a Spice kernel from TLE
Using the toolkit program MKSPK, build a type 10 SPK from your desired TLE. This program will implement the SGP4 model. You will need the 'geophysical.ker' file from the NAIF website, as well as the most recent leapseconds kernel (currently naif0008.tls). I have not tested if Celestia can directly use a type 10 kernel, but I would assume it should have no problems. Doesn't really matter though, because of...
2) Generate xyz data from Spice kernel
Using the toolkit program SPKDIFF, generate a 'difference dump report' between the satellite and body 399, which is the center of the earth. You will need to specify the same kernel twice (e.g. SPKDIFF -b1 399 -b2 <sat_id> -t <output.xyz> kernel.bsp kernel.bsp). This will give you an output file in the format '<jul secs past J2000> <delx> <dely> <delz> <delvx> <delvy> <delvz>', with distances in kilometers. You can change the time format, but how to specify it is documented only in the source code .
To put this in a format Celestia will like you need to convert the time to a Julian date, and drop the last three fields. Should be simple to do with a spreadsheet.
Enjoy!
Note that I have not done this, I've just seen from the docs how it would work. I'm not giving a cookbook here, so you'll need to read the docs and have a clue.
1) Build a Spice kernel from TLE
Using the toolkit program MKSPK, build a type 10 SPK from your desired TLE. This program will implement the SGP4 model. You will need the 'geophysical.ker' file from the NAIF website, as well as the most recent leapseconds kernel (currently naif0008.tls). I have not tested if Celestia can directly use a type 10 kernel, but I would assume it should have no problems. Doesn't really matter though, because of...
2) Generate xyz data from Spice kernel
Using the toolkit program SPKDIFF, generate a 'difference dump report' between the satellite and body 399, which is the center of the earth. You will need to specify the same kernel twice (e.g. SPKDIFF -b1 399 -b2 <sat_id> -t <output.xyz> kernel.bsp kernel.bsp). This will give you an output file in the format '<jul secs past J2000> <delx> <dely> <delz> <delvx> <delvy> <delvz>', with distances in kilometers. You can change the time format, but how to specify it is documented only in the source code .
To put this in a format Celestia will like you need to convert the time to a Julian date, and drop the last three fields. Should be simple to do with a spreadsheet.
Enjoy!