flother / nearest-planet

Python code to discover the nearest planet to Earth. R code to plot it

Home Page:https://www.flother.is/blog/which-planet-is-closest-to-earth/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python script to calculate the distance from Earth to Mercury, Venus, and Mars, and an R script to plot that data. Inspired by an episode of the BBC's More or Less. See my blog post Which planet is closest to Earth? for the full details.

The Python script uses the Skyfield package and the Jet Propulsion Laboratory's DE432 ephemeris to calculate the planets' distance from Earth between 1950 and 2050. The calculations are dumped to a CSV file, and then used as input for the R script.

To collect the data, run:

pip3 install -r requirements.txt
python3 planets.py > planets.csv

Then open the planets.r script in RStudio to plot the data. (Make sure to set the working directory: Session → Set Working Directory → To Source File Location.)

About

Python code to discover the nearest planet to Earth. R code to plot it

https://www.flother.is/blog/which-planet-is-closest-to-earth/

License:MIT License


Languages

Language:R 72.6%Language:Python 27.4%