visualise-orbitn

Visualise solar system simulation output from orbitN in Blender

https://github.com/japhir/visualise-orbitn

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Visualise solar system simulation output from orbitN in Blender

Basic Info
  • Host: GitHub
  • Owner: japhir
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 18 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 3 years ago · Last pushed about 3 years ago
Metadata Files
Readme License Citation

README.md

visualise orbitN output in Blender

orbitN is a symplectic integrator for near-Keplerian planetary systems. This allows us to calculate how the solar system may have evolved over geological time scales, and to interrogate Earth's eccentricity in the geologic past. See Zeebe (2023) for the paper that describes the model. orbitN is available for free on https://github.com/rezeebe/orbitN under the GPL-3 license.

Blender is a free (libre) 3D software that's used in movies and games. Here we use Blender's python API to visualise orbitN output in 3D.

modern-orbits

Example movies

I've made some example movies! To download them, click on the link and go to the top right > Download raw file.

movie of animated modern orbits This is a video of a simulation into the future, with a timestep of 5 days. Because the video plays at 24 frames per second, this means that every second, 120 days pass.

movie of animated orbits for the past 405 kyr This video shows how the orbits dance around over the past 405 thousand years (kyr) from an angle. It also shows what Earth's eccentricity looked like at the time.

movie of animated orbits for the past 405 kyr from the top The same as the above, but now viewed from the top without any perspective corrections (a so-called orthographic view).

Feel free to use these movies for education or other purposes. They are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (whereas the python code is released under GPL-3.0 or later).

License: CC BY-SA 4.0

Installation

  • install orbitN <!-- link to Richard's video/website -->
  • run some example experiments in the subdirectory sim
  • convert cartesian output to keplerian elements using xv2elm
  • install Blender (I'm using 3.5.1)
  • install python dependencies:
    • numpy
    • mathutils
    • math
    • pyorb to convert between cartesian and keplerian elements https://danielk.developer.irf.se/pyorb/index.html
    • bpybb to convert between hexadecimal colours and blender's linear RGB https://github.com/CGArtPython/bpybuildingblocks (or copy the colour conversion over)

Getting Started

  1. Download visualise_orbitN.py by opening it on GitHub, then clicking the Download Raw File button in the top-right (or git clone this repository).
  2. Download visualise_orbitN.blend file for the example output that I created.
  3. Open visualise_orbitN.blend in Blender.
  4. In Blender, click the top panel's "Scripting" to change the layout. Go to Text > Open > select the newly downloaded file.
  5. Change the directory in the function definition of get_files so it points to your orbitN sim directory. Navigate to the bottom of the file, where we invoke the functions.
  6. Uncomment the desired function call and hit the Run Script button (play arrow at the top).

Example blend file

This file has some collections with example visualisations:

modern-highres

I ran orbitN with the 8 planets and pluto for 246.6 years into the future (close to the orbital period of Pluto) with a timestep of 5 days, just to take the model for a spin.

NOTE: I had to eliminate the animation for this from the blend file to reduce its size, so the planets stop moving after 10 frames.

solsys-keplerian

I ran orbitN with the 8 planets and pluto for 60 million years into the past with a timestep of 400 years. (This took about 5:28 hours on my laptop!).

NOTE: I had to delete the 2.4 Myr and 60 Myr pointclouds from the blend file to make the filesize manageable.

collection naming

  • modern high resolution model run with moving planets!
  • meshes all cartesian coordinates in data as vertices (points).
  • orbits animated orbits as grease pencil objects.
  • eccentricity simple line tracing out Earth's eccentricity, with a planet moving along at the same pace as the orbits.

Available functions

At the bottom of the script, the following function invocations are available:

  • make_meshes draws vertices (points) for each of the rows in the data. It also gives the points vertex attributes so that one can use e.g. geometry nodes to tweak the mesh and have access to the age as well as the velocity vector.
    • setting make_planets to True draws spheres for the 8 planets and Pluto, with the planet's sizes * 1000.
    • animate_planets lets the planets move with time. This is slow and only useful for high-resolution modern simulations (otherwise it will jump around too much.)
    • exp simulation subdirectory where the orbitN model output can be found.
    • tmax the maximum age in kyr to subset the data to, rounded up to the nearest one in the data.
    • dt is the timestep in kyr, rounded down to the nearest value in the data.
    • outext is the file extension of the orbitN output files. This is .dat for cartesian coordinates and .elm.dat for the converted keplerian elements.
  • make_animated_orbits draws an orbit ellipse for each row in the data for a new frame using the grease pencil. This is relatively fast, but don't run it for much more than 3 Myr.
  • make_eccentricity_curve draws a simple eccentricity curve for the Earth based on the data. Includes a planet that moves along the curve with time.

```python makemeshes(exp = "modern-highres", makeplanets = True, animate_planets = True)

drawing the points is pretty fast

animating the planets is slow

makemeshes(exp = "solsys-keplerian", tmax = 405, dt = 1, outext = ".dat", makeplanets = False, animate_planets = False)

this is pretty fast, but for the full 60 Myr output that includes values

every 400 years it takes about a minute to load in and is fast after.

makeanimatedorbits(exp = "solsys-keplerian", tmax = 405, dt = 0.8, outext = ".elm.dat")

this pretty fast unless you set tmax to much more than, e.g., 3 Myr

makeeccentricitycurve(exp = "solsys-keplerian", tmax = 405, dt = .8, outext = ".elm.dat", make_planet = True)

this is pretty fast

```

Getting the Night Sky in the background

This repository has instructions on how to download the night's sky from NASA and use it as a world texture HDRI. On the NASA website it says that the first map is in "celestial (J2000 geocentric right ascension and declination)" coordinates, which means that they actually align with our orbits/planets, which are in an inertial reference frame.

References

Zeebe (2023) The Astronomical Journal. orbitN: A Symplectic Integrator for Planetary Systems Dominated by a Central Mass—Insight into Long-term Solar System Chaos DOI:10.3847/1538-3881/acd63b

Owner

  • Name: Ilja Kocken
  • Login: japhir
  • Kind: user
  • Location: The Netherlands
  • Company: @UtrechtUniversity

PhD Candidate in Palaeoclimate | Data Steward for Earth Sciences

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: visualise-orbitN
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Ilja Japhir
    family-names: Kocken
    email: ikocken@hawaii.edu
    affiliation: University of Hawaii at Manoa
    orcid: 'https://orcid.org/0000-0003-2196-8718'
repository-code: 'https://github.com/japhir/visualise-orbitN'
abstract: >-
  orbitN is a symplectic integrator for near-Keplerian
  planetary systems. This allows us to calculate how the
  solar system may have evolved over geological time scales,
  and to interrogate Earth's eccentricity in the geologic
  past. See Zeebe 2023 for the paper that describes the
  model. orbitN will be available for free on
  https://github.com/rezeebe/orbitN under the GPL-3 license.


  Blender is a free (libre) 3D software that's used in
  movies and games. Here we use Blender's python API to
  visualise orbitN output in 3D.
keywords:
  - blender
  - python
  - solar system
  - simulation
  - visualisation
  - visualization
  - orbitN
  - cyclostratigraphy
  - palaeoclimate
  - paleoclimate
license: GPL-3.0-or-later
date-released: '2023-05-31'

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels