A Python library that deals with astronomy and mathematical calculations. It also helps with Julian Dates
Project description
astronomica
Astronomica Usage Exampe
Astronomica is a simple python library based on formulas pioneered at https://www.aa.quae.nl/en/reken/zonpositie.html, and https://astronomica.w3spaces.com/. Scroll below to check out the documentation.
Note of Usage:
Astronomica is 100% free!! It is also driven by the community, so we welcome tips, bug fixes, and more methods added by users and the general python & astronomy community.
Usage:
Here is a very simple usage example of Astronomica:
from astronomica import *
lunar_phase = getLunarPhase()
planting_time = False
if lunar_phase == 'Full':
planting_time = True
sendNotificationToFarmers("It is a full Moon, planting should begin")
else:
waitForFullMoon()
Methods
local_julian_date(date=datetime.datetime.now())
This method returns the current local julian date
fromJulian(j) # j is the julian date to convert
This method returns the gregorian date from a given julian date
get_lunar_age()
This method returns the current age of the moon (in days)
get_lunar_age_percent()
This method returns the current percentage of the lunar cycle completed by the moon
getLunarPhase()
This method returns the current lunar phase
daysSinceJ2000()
This method returns the days since Jan 1st 2000 Epoch
sun = Sun(lat, long)
sun.get_local_sunrise_time()
sun.get_local_sunset_time()
These methods return the sunrise and sunset time
decimalHours(now) # now is the chosen time
This method returns the decimal hours for a given time
localSiderealTime(long)
This method returns the local sidereal time for a given longitude east
altitude(lat, long)
This method returns the current solar altitude on earth for a given longitude east and a latitude north
azimuth(lat, long)
This method returns the current solar azimuth in degrees for a given latitude and longitude east
map_star(star)
This method returns the type of star based on its name.
Observer Class
observer = Observer(lat, long, desired_planet_for_calculations, date=datetime.datetime.now())
Methods in class
julian_date()
returns the current julian date
mean_anomaly()
returns the mean anomaly of the chosen planet specified when initializing the object (see the initialization for details)
equation_of_center()
returns the current equation of center to correct the mean anomaly of the planet.
true_anomaly()
returns the true anomaly of the chosen planet
set_perihelion_and_obliquity()
sets the longitude of the perihelion of the planet's orbit, and its obliquity
ecliptical_longitude()
returns the ecliptical longitude of the sun
equatorial_coordinates()
returns the equatorial coordinates of the sun from the planet (right ascension and declination) as a dictionary.
local_solar_transit()
returns the solar noon julian date for the current day. It can be converted to regular time by fromJulian(j) function
distance_to_sun()
returns the distance to the sun from that planet.
planet_heliocentric_coordinates()
returns the planets rectangular ecliptical heliocentric coordinates (x, y, z)
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
Built Distribution
Hashes for astronomica-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ececdd252e30bf5395f35d5c54118e5e762845f0f1276e73f310277fed30ff29 |
|
MD5 | 7bb58686d5fc73f14df0724a18eced83 |
|
BLAKE2b-256 | b0a07c7597b28f31487fe6f57891cac8845c6aea607ff7dccd1ea6c72ade2efe |