Skip to content

Your Python Code

Uli Scheuss edited this page Dec 26, 2024 · 11 revisions

Using CurveSimulator in Your Python Code

Quick Start

from curvesimulator import curvesim
curvesim("MyFirstConfigFile.ini")

This script:

  • Reads the configuration file
  • Simulates the motions of celestial bodies
  • Generates a video displaying the moving bodies and the resulting light curve The specific behavior of the program is defined in the configuration file.

Advanced Usage

For more detailed analysis of simulation results, use the following code:

from curvesimulator import curvesim
parameters, bodies, lightcurve = curvesim("MyFirstConfigFile.ini")
print(parameters)
print(bodies)
print(lightcurve)

parameters contains configuration settings (excluding celestial body parameters).

bodies holds celestial body parameters from the configuration file and calculated attributes. The bodies[n].positions attribute stores all 3D positions calculated during the simulation for each body (where n is the zero-based index of the body).

lightcurve.array contains all brightness values calculated during the simulation.

Printing these objects provides just basic information. For a comprehensive view of the available data, use a debugger to inspect the objects in detail.