<p>One keyword to search for is &quot;spice kernel&quot;.</p>
<p>SPICE stands for <a href="https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pdf/individual_docs/03_spice_overview.pdf" rel="nofollow noreferrer">Spacecraft Planet Instrument C-matrix Event</a>. That is a type of <a href="https://arc.aiaa.org/doi/pdf/10.2514/6.2018-2366" rel="nofollow noreferrer">data format</a> in which orbital data are commonly provided by ESA, NASA and other institutions dealing with detailed data; it is the <a href="https://ui.adsabs.harvard.edu/abs/2015IAUGA..2240327A/abstract" rel="nofollow noreferrer">recommended format</a> by IAU to use. Often the so-called kernels for objects and missions are also readily available for download and digestion of tools (e.g. <a href="https://naif.jpl.nasa.gov/naif/data.html" rel="nofollow noreferrer">here</a> or <a href="https://naif.jpl.nasa.gov/naif/data.html" rel="nofollow noreferrer">here</a>).</p>
<p>Quite a few poplular solutions are python modules like <a href="https://docs.heliopy.org/en/0.6.5/guide/index.html" rel="nofollow noreferrer">HelioPy</a>, <a href="https://spiceypy.readthedocs.io/en/master/index.html" rel="nofollow noreferrer">SpicePy</a> or <a href="https://docs.poliastro.space/en/stable/index.html" rel="nofollow noreferrer">PoliAstro</a> and possibly <a href="https://github.com/ThomasAlbin/SpaceScienceTutorial" rel="nofollow noreferrer">this tutorial might do what you want</a>. They usually have good documentation with extensive examples for simply copy&amp;paste on how to use them. That said, python is not the only option, there are solutions in other languages as well.</p>
<p>It's also worth to note that some missions come with their own dedicated tools like <a href="http://cassini-mimi.jhuapl.edu/spt/jcsn/ug/index.html" rel="nofollow noreferrer">Cassini's JCSN</a> or <a href="http://www-pw.physics.uiowa.edu/cassini/jbg/satplot2.html" rel="nofollow noreferrer">Cassini orbit plotting tool</a>.</p>
<p>For natural bodies <a href="https://docs.astropy.org/en/stable/coordinates/solarsystem.html" rel="nofollow noreferrer">AstroPy</a>, possibly along with <a href="https://pypi.org/project/jplephem/" rel="nofollow noreferrer">JPLEphem</a> might suffice and prove quite versatile.</p>

CC BY-SA 4.0
2020-08-14T09:26:19.873Z
That's a very good point: «it is the recommended format by IAU to use». I checked SPICE before in the NAIF website and I was not able to find how to install it. But knowing there are so much python modules based on it is really nice. I have a lot of modules to learn, now! I use Python, Bash, C, Go, Ruby, Perl... How do I find more tools in other languages? (Based on SPICE)
Unix
CC BY-SA 4.0
2020-08-14T10:09:51.533Z
https://naif.jpl.nasa.gov/naif/toolkit.html has some further links... more likely at the end of some dedicated search queries with a search engine of your choice. I don't have bookmarks either.
planetmaker
CC BY-SA 4.0
2020-08-14T03:05:01.967Z
2020-08-14T03:30:03.657Z
2020-08-14T03:30:03.657Z
planetmaker
<p>I need to find the way to plot orbit planets and satellites in a coherent way. Let's say I want to generate a chart of the Moon's orbit around the Earth, or the jovian satellites around Jupiter.</p>
<p>The hard way would be the use of a CAD software, manually. However, I'm not sure if I will be able to represent the orbits excentricity. And it would be a slow process, one by one...</p>
<p>My idea is to do it programmatically and recursively, so I can generate hundreds of charts for my articles. Can AstroPy do it? I'm using Debian 9 and I checked poliastro, but I had problems with the requirements... I also checked Xephem, and I could not compile it (it's too old, I think). Could Celestia or Kstars do that?</p>
<p>Any Linux/Unix tool would be fine! Especially if it works from the command line.</p>
<p>EDIT: I tried to compile ORSA without luck. Also failed.</p>
<p>I'm discovering the combo of <code>python3-ephem</code> with <code>gnuplot</code>. I can generate the data with Ephem and plot it with Gnuplot. What do you think about this combo?</p>
<p>EDIT 2:</p>
<p>Not only python3-ephem... Skyfield and REBOUND are good options!</p>

CC BY-SA 4.0
2020-08-13T08:47:35.873Z
Most of the answers will somewhat depend on how you want to see the orbits plotted. Anyhow, have a look at Stellarium.
planetmaker
CC BY-SA 4.0
2020-08-13T08:57:48.997Z
Perpendicular to the ecliptic would be fine for me.
Unix
CC BY-SA 4.0
2020-08-13T09:17:26.190Z
[Skyfield](https://rhodesmill.org/skyfield/) can give you specific data on our solar system and has a Kepler solver module that can generate orbits based on Keplerian elements. Blender can also generate 3D rendered or simply illustrated views of anything and can be scripted from Python and even run programmatically/automatically as a Python module without running the GIU if you like and it even has its own [Stack Exchange site](https://blender.stackexchange.com/)! Are these kinds of things along the lines of what you need? If so I can write up a short answer.
uhoh
CC BY-SA 4.0
2020-08-13T09:19:31.613Z
See also [Where can I find/visualize planets/stars/moons/etc positions?](https://astronomy.stackexchange.com/q/13488/7982)
uhoh
CC BY-SA 4.0
2020-08-13T09:48:46.493Z
@uhoh, yeah, Skyfield looks nice. I'm gonna take a look at it, firstly. This other answer you link here has a lot of tools. Now what I need is time to check them. Thanks a lot!
Unix
CC BY-SA 4.0
2020-08-13T10:03:33.573Z
These are old and there are probably better examples there, but they give a little flavor at least: [How to make precisely defined trails along orbits in space](https://blender.stackexchange.com/q/33993) and [How to make this animation look more like a satellite orbiting a binary star?](https://blender.stackexchange.com/q/51585) and [How to add “celestial objects” (extremely distant images) that behave correctly](https://blender.stackexchange.com/q/44728/5334)
uhoh
CC BY-SA 4.0
2020-08-13T10:11:11.383Z
Blender is very nice for 3D simulations. Once I implemented the rotation matrix formula in three dimensions for basic rotations to paint the sky (Sky Texture) according to the Sun position (`SunLamp` orientation coordinates). I would love to do more on it!
Unix
CC BY-SA 4.0
2020-08-13T10:15:52.673Z
As I can see, Skyfield can do everything PyEphem does. They implemented everything, according to an issue on Github. So they are quite similar. I could install both with success: python-ephem and python3-ephem are in the repositories. Skyfield via pip package manager.
Unix
CC BY-SA 4.0
2020-08-13T10:20:25.007Z
However, poliastro looks very good as well. I think I need to install Python 3.8 in a virtual env and then install all this stuff there, so I don't break the native Python version of the system.
Unix
CC BY-SA 4.0
2020-08-13T11:38:37.213Z
I would reccomend, REBOUND for Python. It is very intuitive when you do a few tutorials. As an example it allowed me to plot this: https://www.youtube.com/watch?v=BWAIq5gi198
Swike
CC BY-SA 4.0
2020-08-13T12:33:43.490Z
@Swike, REBOUND is awesome! I could generate my first PNG image from the examples! Thanks a lot!
Unix
CC BY-SA 4.0
2020-08-14T09:06:26.053Z
How fancy do you want the graphics to be? If you can write Python, it's easy to create simple 2D graphics directly with the Python Imaging Library, PIL (please use the modern fork, [Pillow](https://pillow.readthedocs.io/en/stable/)). OTOH, REBOUND looks pretty awesome. :)
PM 2Ring
CC BY-SA 4.0
2020-08-14T09:30:18.033Z
@PM2Ring, 2D graphics are fine. About Pillow, could I do a bit of CAD or plotting with it? I've been searching a tool for that, as well, being Eukleides and Asymptote the only two languages I discovered at the moment.
Unix
CC BY-SA 4.0
2020-08-14T09:38:19.030Z
Yes, you can do simple pixel graphics and drawing commands with PIL, and save the results in most common bitmap image file formats. PIL only has very simple facilities for displaying an image, I often use it in conjunction with Tkinter if I need interactive graphics, or want to watch an image as it's being plotted. PIL has facilities for exchanging data with Numpy, which is handy when you need to do a lot of number crunching.
PM 2Ring
CC BY-SA 4.0
2020-08-14T09:45:54.183Z
OTOH, PIL doesn't support vector based image formats like EPSF or SVG. (All modern browsers support SVG, and it can easily be converted to PostScript or PDF for high quality printing). The Tkinter Canvas can be used for vector based drawing operations, and save the result as EPSF, but I've never tested its EPSF support. But I have done some work in Python that creates SVG data directly (i.e., without using an SVG library). Here's a basic example of SVG plotting I did 6 years ago. It's in Python 2, but it should be easy to convert to Python 3. https://unix.stackexchange.com/a/166921/88378
PM 2Ring
CC BY-SA 4.0
2020-08-14T09:52:45.330Z
@PM2Ring, or LaTeX libraries as well. I will use Tikz for some things.
Unix
<astropy>
How do I plot orbit planets and satellites?
Unix
# How do I plot orbit planets and satellites?

(Asked by: username_0 on 2020-08-13)

I need to find the way to plot orbit planets and satellites in a coherent way. Let's say I want to generate a chart of the Moon's orbit around the Earth, or the jovian satellites around Jupiter.

The hard way would be the use of a CAD software, manually. However, I'm not sure if I will be able to represent the orbits excentricity. And it would be a slow process, one by one...

My idea is to do it programmatically and recursively, so I can generate hundreds of charts for my articles. Can AstroPy do it? I'm using Debian 9 and I checked poliastro, but I had problems with the requirements... I also checked Xephem, and I could not compile it (it's too old, I think). Could Celestia or Kstars do that?

Any Linux/Unix tool would be fine! Especially if it works from the command line.

EDIT: I tried to compile ORSA without luck. Also failed.

I'm discovering the combo of `python3-ephem` with `gnuplot`. I can generate the data with Ephem and plot it with Gnuplot. What do you think about this combo?

EDIT 2:

Not only python3-ephem... Skyfield and REBOUND are good options!

**Tags:** astropy
> **Comments:**
> **username_1**: Most of the answers will somewhat depend on how you want to see the orbits plotted. Anyhow, have a look at Stellarium.  
> **username_0**: Perpendicular to the ecliptic would be fine for me.  
> **username_2**: [Skyfield](https://rhodesmill.org/skyfield/) can give you specific data on our solar system and has a Kepler solver module that can generate orbits based on Keplerian elements. Blender can also generate 3D rendered or simply illustrated views of anything and can be scripted from Python and even run programmatically/automatically as a Python module without running the GIU if you like and it even has its own [Stack Exchange site](https://blender.stackexchange.com/)! Are these kinds of things along the lines of what you need? If so I can write up a short answer.  
> **username_2**: See also [Where can I find/visualize planets/stars/moons/etc positions?](https://astronomy.stackexchange.com/q/13488/7982)  
> **username_0**: @uhoh, yeah, Skyfield looks nice. I'm gonna take a look at it, firstly. This other answer you link here has a lot of tools. Now what I need is time to check them. Thanks a lot!  
> **username_2**: These are old and there are probably better examples there, but they give a little flavor at least: [How to make precisely defined trails along orbits in space](https://blender.stackexchange.com/q/33993) and [How to make this animation look more like a satellite orbiting a binary star?](https://blender.stackexchange.com/q/51585) and [How to add “celestial objects” (extremely distant images) that behave correctly](https://blender.stackexchange.com/q/44728/5334)  
> **username_0**: Blender is very nice for 3D simulations. Once I implemented the rotation matrix formula in three dimensions for basic rotations to paint the sky (Sky Texture) according to the Sun position (`SunLamp` orientation coordinates). I would love to do more on it!  
> **username_0**: As I can see, Skyfield can do everything PyEphem does. They implemented everything, according to an issue on Github. So they are quite similar. I could install both with success: python-ephem and python3-ephem are in the repositories. Skyfield via pip package manager.  
> **username_0**: However, poliastro looks very good as well. I think I need to install Python 3.8 in a virtual env and then install all this stuff there, so I don't break the native Python version of the system.  
> **username_3**: I would reccomend, REBOUND for Python. It is very intuitive when you do a few tutorials. As an example it allowed me to plot this: https://www.youtube.com/watch?v=BWAIq5gi198  
> **username_0**: @Swike, REBOUND is awesome! I could generate my first PNG image from the examples! Thanks a lot!  
> **username_4**: How fancy do you want the graphics to be? If you can write Python, it's easy to create simple 2D graphics directly with the Python Imaging Library, PIL (please use the modern fork, [Pillow](https://pillow.readthedocs.io/en/stable/)). OTOH, REBOUND looks pretty awesome. :)  
> **username_0**: @PM2Ring, 2D graphics are fine. About Pillow, could I do a bit of CAD or plotting with it? I've been searching a tool for that, as well, being Eukleides and Asymptote the only two languages I discovered at the moment.  
> **username_4**: Yes, you can do simple pixel graphics and drawing commands with PIL, and save the results in most common bitmap image file formats. PIL only has very simple facilities for displaying an image, I often use it in conjunction with Tkinter if I need interactive graphics, or want to watch an image as it's being plotted. PIL has facilities for exchanging data with Numpy, which is handy when you need to do a lot of number crunching.  
> **username_4**: OTOH, PIL doesn't support vector based image formats like EPSF or SVG. (All modern browsers support SVG, and it can easily be converted to PostScript or PDF for high quality printing). The Tkinter Canvas can be used for vector based drawing operations, and save the result as EPSF, but I've never tested its EPSF support. But I have done some work in Python that creates SVG data directly (i.e., without using an SVG library). Here's a basic example of SVG plotting I did 6 years ago. It's in Python 2, but it should be easy to convert to Python 3. https://unix.stackexchange.com/a/166921/88378  
> **username_0**: @PM2Ring, or LaTeX libraries as well. I will use Tikz for some things.  

---

## 1 answers

### Answer by username_1 on 2020-08-14. Score: 3 | Accepted answer

One keyword to search for is "spice kernel".

SPICE stands for [Spacecraft Planet Instrument C-matrix Event](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pdf/individual_docs/03_spice_overview.pdf). That is a type of [data format](https://arc.aiaa.org/doi/pdf/10.2514/6.2018-2366) in which orbital data are commonly provided by ESA, NASA and other institutions dealing with detailed data; it is the [recommended format](https://ui.adsabs.harvard.edu/abs/2015IAUGA..2240327A/abstract) by IAU to use. Often the so-called kernels for objects and missions are also readily available for download and digestion of tools (e.g. [here](https://naif.jpl.nasa.gov/naif/data.html) or [here](https://naif.jpl.nasa.gov/naif/data.html)).

Quite a few poplular solutions are python modules like [HelioPy](https://docs.heliopy.org/en/0.6.5/guide/index.html), [SpicePy](https://spiceypy.readthedocs.io/en/master/index.html) or [PoliAstro](https://docs.poliastro.space/en/stable/index.html) and possibly [this tutorial might do what you want](https://github.com/ThomasAlbin/SpaceScienceTutorial). They usually have good documentation with extensive examples for simply copy&paste on how to use them. That said, python is not the only option, there are solutions in other languages as well.

It's also worth to note that some missions come with their own dedicated tools like [Cassini's JCSN](http://cassini-mimi.jhuapl.edu/spt/jcsn/ug/index.html) or [Cassini orbit plotting tool](http://www-pw.physics.uiowa.edu/cassini/jbg/satplot2.html).

For natural bodies [AstroPy](https://docs.astropy.org/en/stable/coordinates/solarsystem.html), possibly along with [JPLEphem](https://pypi.org/project/jplephem/) might suffice and prove quite versatile.

> **Comments:**
> **username_0**: That's a very good point: «it is the recommended format by IAU to use». I checked SPICE before in the NAIF website and I was not able to find how to install it. But knowing there are so much python modules based on it is really nice. I have a lot of modules to learn, now! I use Python, Bash, C, Go, Ruby, Perl... How do I find more tools in other languages? (Based on SPICE)  
> **username_1**: https://naif.jpl.nasa.gov/naif/toolkit.html has some further links... more likely at the end of some dedicated search queries with a search engine of your choice. I don't have bookmarks either.  

---

