This project provides tools to visualize the solar system in either heliocentric or geocentric views using a polar coordinate system. Users can plot celestial positions for a specific date or generate an animated GIF showing movements over time.
- Heliocentric and Geocentric Views: Choose between visualizing planetary positions relative to the Sun or Earth.
- Custom Date Input: Specify the date for plotting celestial bodies.
- GIF Generation: Create animations for a specified time range and interval.
- User-Friendly Output: Plots are either displayed interactively or saved in an
output
directory.
The project requires the following third-party Python packages:
ephem
imageio
matplotlib
Install the dependencies using the requirements.txt
file:
pip install -r requirements.txt
- Clone this repository:
git clone git@github.com:opethef10/solar_system_plotter.git cd solar_system_plotter
- Install the required dependencies:
pip install -r requirements.txt
Argument | Description | Default |
---|---|---|
--geocentric |
Plot the geocentric view (default is heliocentric). | False |
--date |
Date to plot (format: %Y-%m-%d ). |
Today's date |
--gif |
Create a GIF animation. | False |
--duration |
Total number of days to include in the animation (GIF mode). | 1000 |
--interval |
Interval in days between frames in the GIF (GIF mode). | 5 |
-
Plot a heliocentric view for the current date:
python __main__.py
-
Plot a geocentric view for a specific date:
python __main__.py --geocentric --date "2024-01-01"
-
Generate a heliocentric GIF for 100 days with a 10-day interval:
python __main__.py --gif --duration 100 --interval 10
Plots and GIFs are saved in the output
directory under the project folder. The filenames include the type of view (geo
or solar
) and the date.
- Heliocentric View: Plots planets around the Sun at their ecliptic longitudes.
- Geocentric View: Plots planets around Earth using right ascension values.
- GIF Creation: Saves frames in memory and compiles them into a GIF using
imageio
.
- The Moon's radius is fixed at
0.5
for visualization purposes in geocentric plots. - The script uses
ephem
to compute celestial positions accurately.
This project is licensed under the MIT License. See LICENSE
for details.