mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-03-28 17:32:36 +01:00
Update solarconditions.py
This commit is contained in:
@@ -112,10 +112,16 @@ def get_moon(lat=0, lon=0):
|
||||
moon_table['illumination'] = moon.phase
|
||||
moon_table['azimuth'] = moon.az
|
||||
moon_table['altitude'] = moon.alt
|
||||
moon_table['rise_time'] = obs.next_rising(moon).strftime('%a %d %I:%M')
|
||||
moon_table['set_time'] = obs.next_setting(moon).strftime('%a %d %I:%M')
|
||||
moon_table['next_full_moon'] = ephem.next_full_moon(ephem.localtime(obs.date)).strftime('%m %a %d %I:%M')
|
||||
moon_table['next_new_moon'] = ephem.next_new_moon(ephem.localtime(obs.date)).strftime('%m %a %d %I:%M')
|
||||
|
||||
local_moonrise = ephem.localtime(obs.next_rising(moon))
|
||||
local_moonset = ephem.localtime(obs.next_setting(moon))
|
||||
moon_table['rise_time'] = local_moonrise.strftime('%a %d %I:%M')
|
||||
moon_table['set_time'] = local_moonset.strftime('%a %d %I:%M')
|
||||
|
||||
local_next_full_moon = ephem.localtime(ephem.next_full_moon((obs.date)))
|
||||
local_next_new_moon = ephem.localtime(ephem.next_new_moon((obs.date)))
|
||||
moon_table['next_full_moon'] = local_next_full_moon.strftime('%a %d %I:%M')
|
||||
moon_table['next_new_moon'] = local_next_new_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'])) + "%" \
|
||||
|
||||
Reference in New Issue
Block a user