python package for lunar and solar information


License
MIT
Install
pip install lunastro==0.0.14

Documentation

Lunastro

Lunastro is a python library for calculating astronomical data, such as, but not limited to:

  • RA of the sun
  • Hour angle of the sun
  • Declination of the sun
  • Longitude of the Sun's Ascending Node (Omega)
  • Solar Geometric mean Anomaly
  • Solar Geometric mean Longitude
  • True Solar Longitude
  • Distance to the sun
  • Local sidereal time (accurate to the second)
  • Sun altitude
  • Sun azimuth
  • Moon Position

Usage

Lunastro's functions return objects of information. Here is a list of each function and what it returns:

Solar Data

latitude = 47.6101 # Bellevue WA latitude
solar_data = getSunData(latitude) # get the solar data

This returns:

Attribute Description
dec current solar declination
hour_angle current solar hour angle
ra current solar right ascension
long_omega Longitude of the Sun's ascending node
true_solar_anomaly true solar anomaly
true_solar_longitude true solar longitude
geo_anomaly geometric mean anomaly of the sun
geo_long geometric mean longitude of the sun
dist distance to the sun in miles

Altitude of the Sun

# lat and long are of Bellevue WA
latitude = 47.6101
longitude = -122
alt = altitude(latitude, longitude)

This returns the altitude of the sun in radians

Azimuth of the Sun

# lat and long are of Bellevue WA
latitude = 47.6101
longitude = -122
azi = azimuth(latitude, longitude)

This returns the azimuth of the sun in radians

Local Sidereal Time

# longitude 
long = -122
time = localSiderealTime(long)

This returns the local sidereal time as an object:

Attribute Description
raw raw sidereal time
hour hours of sidereal time
minute minutes of sidereal time
second seconds of sidereal time

Moon Positioning

# lat and long are of Bellevue WA
lat = 47.6101
long = -122
moon_pos = getMoonPosition(lat, long)

This returns the positioning of the moon as an object:

Attribute Description
azimuth azimuth of the moon
altitude altitude of the moon
distance distance to the moon in KM
parallacticAngle parallactic angle of the moon

Changelog

Version 0.0.21 (March 18th 2023)

  • Edited most of the files by making the functions more accurate. Changed the functions to output objects.