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 Build Status

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 orbiting Earth

solarsystem is a python library for finding position of planets around Sun or around Earth.

Also with solarsystem we can find positions around Sun/Earth of dwarf planets (only 3 planets so far) and Chiron Centaur and position of moon around Earth

Furthermore we compute sunrise/sunset, moonrise/moonset and moon phase for given place (geocoordinates).

Except all computation above with this library a set of usefull functions are included with which we can convert 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 )

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.83       -4.06        0.47
# Venus       5.23         -3.22        0.73
# Earth       79.47         0.0         0.98
# Mars        214.38        0.49        1.59
# Jupiter     276.1         0.1         5.23
# Saturn      292.51        0.05        10.05
# Uranus      35.35         359.52      19.81
# Neptune     348.02       -1.04        29.91
# Pluto       292.75        359.33      33.88
# Ceres       290.87       -5.4         2.92
# Chiron      4.33          2.94        18.81
# Eris        23.55        -11.74       96.0

     

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.

Exception: example notebook Solar System Live, matplotlib is needed in order to view the plot

     

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

 

Project details


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.2.tar.gz (15.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: solarsystem-0.1.2.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for solarsystem-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5ac8d9c6b91aff7c624a78a24646d98676d7419c18e5caabca93ecfe8c627035
MD5 1450759326abc18c625de940327dbd35
BLAKE2b-256 e7274c2354535bdc23d13d3ff226962ac69d6bacdad74ab4fcef548b6ebbd9f7

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