python package for lunar and solar information
Project description
lunastro
lunastro is a python library for lunar and solar information. It provides astronomers, data experts, and python developers with a quick, easy, and accurate approach to get information on celestial bodies.
To install lunastro:
pip install lunastro
Functions and their output
"""
Lunar functions
"""
get_lunar_phase() # returns the current lunar phase as words
get_lunar_age() # returns age of moon
get_lunar_age_percentage() # returns age percentage of moon
get_lunar_phase_description() # returns description of the current moon phase
"""
Solar Functions
"""
solardistance() # returns distance to the sun in miles
declination(galactic_latitude, galactic_longitude) # solar declination
eclipticlongtitude(anomaly) # ecliptic longitude
rightAscension(galactic_latitude, galactic_longitude) # right Ascension
azimuth(hour_angle, latitude, declination) # azimuth
hourangle() # returns solar hour angle (approximate)
mean_solar_time(longitude) # returns mean solar time
solar_mean_anomaly(longitude) # returns anomaly
center_equation(longitude) # returns center
"""
Constellation Function
"""
getViewableConstellations(latitude) # calculates the constellations that you can see (out of the 88 internationally recognized ones) based on latitude. Doesn't take into account other factors such as height or obstructions to the sky.
Astronomical Measurement Functions:
lightyeardist_to_miles(lightyears) # returns miles
miles_to_lightyeardist(miles) # returns lightyeardistance
miles_to_au(miles) # returns astronomical units
au_to_miles(au) # returns miles from astronomical units
parsec_to_miles(parsec) # returns miles from parsec (3.26 light years is a parsec)
miles_to_parsec(miles) # returns parsecs from miles
kilometers_to_au(self, kilometers, rounded) # if rounded is set to true, it rounds value, else ,it returns au from kilometers
au_to_kilometers(self, au) # returns kilometers from au
kilometers_to_parsec(self, kilometers) # returns parsec from kilometers
parsec_to_kilometers(self, parsecs) # returns kilometers from parsecs
kilometers_to_lightyeardist(self, kilometers) # returns lightyear dist from kilometers
lightyeardist_to_kilometers(self, lightyears) # returns kilometers from lightyears
Usage:
To use your functions, make sure to declare an instance of the class:
# if desiring sun information
from lunastro import Sun
sun = Sun()
# if desiring moon information
from lunastro import myMoon
moon = myMoon()
# if desiring astronomical conversions
from lunastro import Measurement
measure = Measurement()
# if desiring constellation information
from lunastro import Stellar
stars = Stellar()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lunastro-0.0.11.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for lunastro-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e32fa136593c162bbb56d4091a7c657047047d76710215c9dd1f693be5b45fd |
|
MD5 | 9720ddfdc6c7e795e8c3c15c13d3ca25 |
|
BLAKE2b-256 | dfd92da0b5d9dcd1ebe7ffc262f535d4428a375f142f5cd847ee0fd71fb9d95a |