Update solarconditions.py

This commit is contained in:
SpudGunMan
2024-06-19 21:18:35 -07:00
parent 1f09bf8b2e
commit 3eddecb8ea

View File

@@ -96,7 +96,7 @@ def get_sun(lat=0, lon=0):
sun_table['rise_time'] = local_sunrise
sun_table['set_time'] = local_sunset
sun_table['transit_time'] = obs.next_transit(sun).datetime().strftime('%a %d %I:%M')
sun_table['transit_time'] = ephem.localtime(obs.next_transit(sun)).strftime('%a %d %I:%M')
sun_table['direction'] = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'][round(sun.az / (2 * ephem.pi / 8)) % 8]
sun_data = f"Next Sun Rise:" + sun_table['rise_time'] + "\nSet:" + sun_table['set_time'] \
@@ -126,12 +126,12 @@ def get_moon(lat=0, lon=0):
# distance from earth in km
moon_table['earth_distance'] = moon.earth_distance * ephem.meters_per_au / 1000
moon_table['parallactic_angle'] = moon.parallactic_angle()
moon_table['rise_time'] = obs.next_rising(moon).datetime().strftime('%Y-%m-%d %H:%M:%S')
moon_table['set_time'] = obs.next_setting(moon).datetime().strftime('%Y-%m-%d %H:%M:%S')
moon_table['transit_time'] = obs.next_transit(moon).datetime().strftime('%Y-%m-%d %H:%M:%S')
moon_table['rise_time'] = ephem.localtime(obs.next_rising(moon)).strftime('%a %d %I:%M')
moon_table['set_time'] = ephem.localtime(obs.next_rising(moon)).strftime('%a %d %I:%M')
moon_table['transit_time'] = ephem.localtime(obs.next_rising(moon)).strftime('%a %d %I:%M')
moon_table['direction'] = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'][round(moon.az / (2 * ephem.pi / 8)) % 8]
moon_table['next_full_moon'] = ephem.localtime(ephem.next_full_moon(obs.date)).strftime('%Y-%m-%d %H:%M:%S')
moon_table['next_new_moon'] = ephem.localtime(ephem.next_new_moon(obs.date)).strftime('%Y-%m-%d %H:%M:%S')
moon_table['next_full_moon'] = ephem.localtime(obs.next_rising(moon)).strftime('%a %d %I:%M')
moon_table['next_new_moon'] = ephem.localtime(obs.next_rising(moon)).strftime('%a %d %I:%M')
moon_data = f"Moon Rise:" + moon_table['rise_time'] + " Set:" + moon_table['set_time'] + "\nMoon Phase:" \
+ moon_table['phase'] + " @:" + str('{0:.2f}'.format(moon_table['illumination'])) + "%" + "\nMoon Azimuth:" + str(moon_table['azimuth']) \