I'm designing a space interplanetary mission (Design of low-energy trajectories to Near Earth Objects) by using Fortran.

Basically I'm working with the Circular Restricted 3 Body Problem (CR3BP), Lagrange Points, Invariant Manifold, so I'm dealing with Heliocentric Inertial Reference Frame (heliocentric IAU76/J2000 ecliptic, from NASA JPL small bodies ephemerides) and synodical baricentric reference frame with two primary bodies, the Sun and the system Earth-Moon.

Once I will get the data, stored as arrays in .txt or .csv files I suppose, I would like to visualize them by using a 3D space simulation software (by doing an internet research, I found potential candidates: GMAT, FreeFlyer, STK, Celestia, Space engine).

I would like to exploit 3D bodies and their dynamics already present in the software (Sun, Earth, asteroids and comets) and have the possibility to import 3D objects such as CAD of spacecraft (or perhaps use spacecraft models embedded in the software). Of course with Fortran I will find only the dynamics(trajectory) of the spacecraft, so the software has to have embedded the dynamics of the natural celestial objects. I remark that I will use the software mainly as a post processor and not for the numerical propagation (that I will perform in Fortran).

Can you tell me what are the software more useful for my scope?

P.S. More answers are welcome!

  • 8
    $\begingroup$ Fortran is not an issue in producing the data. It's just a programming language. Getting the data produced by the processor into a format a post processor can use might be. It's just data. If you have written the Fortran code used by the processor you can change the output format to whatever you like or whatever is required. Knowing the data format used or accepted by a post processor is the key. If you didn't write the Fortran code used by the processor you might need an intermediary application to convert the data format from the processor to whatever a post processor requires. $\endgroup$
    – Fred
    Jan 31, 2022 at 7:53

2 Answers 2


enter image description here One option is SPICE-Enhanced Cosmographia. You could convert your output text files to SPICE SPK (.bsp extension) kernels or more simply a text file with structured data (see the InterpolatedStates section of this page for more details: https://cosmoguide.org/trajectory-types/ ) which can be read in by Cosmographia. You can also import spacecraft CAD models (.3ds works best). Cosmographia already has all the planets and many small bodies loaded (via SPICE kernels). You can always add more if you want by the same process of adding spacecraft trajectories. You can also input spacecraft attitude quaternions (SPICE kernels) to show attitude control

You can also define custom non-inertial reference frames via SPICE kernels, such as the CR3BP rotating reference frame (Lucy's trajectory in the Sun-Jupiter rotating frame): enter image description here

Here are some more examples of what it looks like:

enter image description here enter image description here enter image description here

SPICE was originally written in Fortran. I have never used the Fortran version but OP is experienced in the language so I think OP could figure it out easily: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pdf/individual_docs/41_program_fortran.pdf

For those who have experience with Python, there is a 3rd party SPICE wrapper to CSPICE called SpiceyPy ( https://spiceypy.readthedocs.io/en/master/documentation.html ) that can be used to write SPK kernels with any of their functions starting with "SPKW". Here is one of them: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkw09_c.html

Overall there is a little learning curve (SPICE basics, Python, JSON), but once you learn how to use it its super powerful. I made a video series in my work YouTube that goes through everything in detail:

  • 4
    $\begingroup$ +n! voting n-factorial as usual! Probably most people can not convert text files to proper SPICE SPK (.bsp extension) kernels without some help or guidance, so the .csv option seems a lot easier. Are there constraints? Can they be unevenly spaced in time? How does the program interpolate? Linear? Spline? NASA's favorite flavor of Chebyshev polynomial? $\endgroup$
    – uhoh
    Jan 30, 2022 at 22:34
  • 2
    $\begingroup$ @uhoh Good points, I added some links to the answer (turns out its not CSV!). As far as interpolation of text data files, they don't mention which type they use. My guess would be Chebyshev but I don't know. I believe that as long as the ephemeris times are in ascending order it works. To be honest I haven't used that functionality (I've only ever used SPICE kernels) so I can't say for sure. Overall this program is powerful but takes longer to show how to use than 1 post. I've spent countless hours learning it at work so I feel comfortable with it now but certainly not at the beginning $\endgroup$ Jan 31, 2022 at 0:02
  • 1
    $\begingroup$ @uhoh I think thats a setting on the channel itself (its my work not my personal so I don't control it). $\endgroup$ Jan 31, 2022 at 0:04
  • 1
    $\begingroup$ If you made the video, please allow it to "view in other websites", like Stack Exchange. Otherwise it will produce a ugly error. $\endgroup$ Jan 31, 2022 at 3:33
  • 1
    $\begingroup$ @VScode_fanboy just updated it $\endgroup$ Jan 31, 2022 at 14:55

I would recommend checking out FreeFlyer (although GMAT and STK may be interchangeable in your use case). NASA's Johnson Space Center uses FreeFlyer for space mission design and operations as it contains a very comprehensive set of capabilities and features. These include celestial body modeling and 3D object visualization which you are looking for.

FreeFlyer contains a built in SolarSystem object that provides control over how the software models the physical solar system environment. For anything beyond the standard set of included celestial bodies (eight planets, Earth's moon, Sun, Pluto), there is capability for user-defined CelestialObjects that can be propagated using a two body propagator or a spice ephemeris propagator.

FreeFlyer also provides tools for visualizing custom 3D models of Spacecraft. Supported import file types include .3ds, .prj, .lwo, .lxo, .obj, .stl.

Useful Help File links:

Getting Started With FreeFlyer

Vehicle 3D Models

Celestial Objects

Solar System

  • $\begingroup$ Hi @Angel Rocha, thanks for your answer. I have some questions (keeping in mind that my purpose is a visualization of the results obtained in Fortran): 1 - Is FreeFlyer freely available for Italian University students? 2 - What are main differencies with respect to the tool presented in the previous answer of this topic, i.e. SPICE-Enhanced Cosmographia? 3 -By considering that I'm able to program in Matlab and I am a beginner in Fortran programming, according your opinion what of two tools is better for me? $\endgroup$
    – g_don
    Feb 2, 2022 at 10:58
  • 1
    $\begingroup$ FreeFlyer is expensive for businesses (though not nearly so expensive as STK!), but it is free for university students according to the manufacturer's page at ai-solutions.com/freeflyer-astrodynamic-software/… It has its own scripting language, different from both Matlab and Fortran, but not any harder than anything else you might have to learn. $\endgroup$
    – Ryan C
    Feb 3, 2022 at 22:29
  • $\begingroup$ Ok, so according your opinion FreeFlyer is easier than SPICE-Enhanced Cosmographia for a beginner user? $\endgroup$
    – g_don
    Feb 3, 2022 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.