Skip to main content

Our Solar System. Planet's positions, Sun's and Moon' s position and rise/set

Project description

SOLARSYSTEM

PyPI version Documentation Status Downloads

Our Solar System consists of:

  • our Star, the Sun
  • 8 Planets: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune
  • Some dwarf Planets: Pluto, Ceres, Eris, (Haumea, Makemake, Quaoar, Sedna, Orcus, 2007 OR10, not yet included here)
  • Some Centaurs: Chiron (onlyone included here)
  • Many moons orbiting planets. Our Moon (Selene in Greek or Luna in Latin) is included here.

solarsystem is a python library for calculating the position (approximately) of planets around Sun or around Earth.

Also with solarsystem we can find the locations around Sun/Earth of the dwarf planets (Pluto, Ceres and Eris here), the Chiron Centaur and the location of moon around Earth.

Furthermore we compute the sunrise/sunset, moonrise/moonset datetimes as well as the moon phase for any given place on Earth (geocoordinates).

In addition, a set of useful functions are included for converting between coordinate systems:

  • Transform spherical to rectangular projection.
  • Transform rectangular to spherical projection.
  • Transform ecliptic to equatorial projection.
  • Transform equatorial to ecliptic projection.
  • Transform eclipitc to spherical projection.
  • Transform spherical to eclipitc projection.

     

Quick start

import solarsystem

Initialize class

H = solarsystem.Heliocentric(year=2020, month=1, day=1, hour=12, minute=0, precession=True)

Compute position of planets around sun

planets_dict=H.planets()
print('Planet','   \t','Longitude','   \t','Latitude','   \t','Distance in AU')
for planet in planets_dict:
    pos=planets_dict[planet]
    print(planet,'   \t',round(pos[0],2),'   \t',round(pos[1],2),'   \t',round(pos[2],2))
# Planet      Longitude   Latitude    Distance in AU
# Mercury     263.55       -4.06       0.47
# Venus         4.95       -3.22       0.73
# Earth       100.25        0.0        0.98
# Mars        214.1         0.49       1.59
# Jupiter     275.83        0.1        5.23
# Saturn      292.23        0.05      10.05
# Uranus       35.07      359.52      19.81
# Neptune     347.74       -1.04      29.91
# Pluto       292.47      359.33      33.88
# Ceres       290.44       -5.4        2.92
# Chiron        3.86        2.94      18.81
# Eris         23.08      -11.74      96.0

     

  • In version 0.1.6 'precession' (of the equinoxes) was added in calculations with True been the default value.

Examples - Use Cases

     

Documentation

The full documentation is available at solarsystem.readthedocs.io    

Alternatively you can build documentation:

install sphinx

Go to docs/ directory

cd docs

Build html files

make html

Open _build/html/index.html in browser.

     

Installation

install from Pypi:

pip install solarsystem

Latest version from source:

pip install git+https://github.com/IoannisNasios/solarsystem

     

Requirements

No requirements, no additional libraries needs to be installed.

Exceptions:

  • For the example notebook Solar System Live, the matplotlib library is needed in order to view the plot
  • For the python code tests, libraries pytest and numpy are required

     

Python versions

  • solarsystem is tested and runs normal for python versions 3.4+ and 2.7
  • running solarsystem on previous python versions should also run but use with caution.

     

Citing

If you find this library useful, please consider citing:

@misc{Nasios:2020,
  Author = {Ioannis Nasios},
  Title = {solarsystem},
  Year = {2020},
  Publisher = {GitHub},
  Journal = {GitHub repository},
  Howpublished = {\url{https://github.com/IoannisNasios/solarsystem}}
}

     

License

solarsystem is MIT-licensed. Read License

 

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solarsystem-0.1.6.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solarsystem-0.1.6-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file solarsystem-0.1.6.tar.gz.

File metadata

  • Download URL: solarsystem-0.1.6.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for solarsystem-0.1.6.tar.gz
Algorithm Hash digest
SHA256 dc834d8954a704f0fe6f2780106cbbf92a2466bc7ddd03e3c6dcc7fbd512fe4e
MD5 67f08e297b40ffd7fa028f979bd93249
BLAKE2b-256 548d02e60cf6fc499fdd93e70d541dd412cf7a1e2d26287453a04c37d91bbf5f

See more details on using hashes here.

File details

Details for the file solarsystem-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: solarsystem-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for solarsystem-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb99ba6df9b7895448278c58700ef026d72b539c04a21d759c1e3c02f21f14b
MD5 241e91134e32e1b5058aadcec68d9537
BLAKE2b-256 b339bd2f98e378833248b9fdf7192ec80a2744cb78bd8645cb7afd825387c695

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page