allow adjusting moon size

main
Dessa Simpson 2024-07-14 16:31:20 -07:00
parent 7e36e07996
commit 809e9ed87c
1 changed files with 3 additions and 4 deletions

View File

@ -26,7 +26,7 @@ def to_timestr(t, date=False, local=True):
return t.strftime('%Y-%m-%d %H:%M:%S')
return t.strftime('%H:%M:%S')
def fmt(cols, t, az, el, phase, illum, moonrise, transit, moonset, hemi):
def fmt(cols, t, az, el, phase, illum, moonrise, transit, moonset, moonlines, hemi):
"""Formats data into string to print"""
_date = t.utc_datetime().astimezone().strftime('%Y-%m-%d %H:%M:%S') # 18 chars
_azel = f"Az:{az.degrees:.0f}° El:{el.degrees:.0f}°".ljust(16) # 16 chars
@ -34,8 +34,7 @@ def fmt(cols, t, az, el, phase, illum, moonrise, transit, moonset, hemi):
_r = f"R:{to_timestr(moonrise)}" # 10 chars
_t = f"T:{to_timestr(transit)}" # 10 chars
_s = f"S:{to_timestr(moonset)}" # 10 chars
# TODO: 21 needs to scale
_moon = putmoon(phase.degrees/360, 21, hemi) # ! scalable width
_moon = putmoon(phase.degrees/360, moonlines, hemi) # ! scalable width
# 2 groups of spacing, filling cols minus total RTS width
_rts_spacing = ' '*int((cols-30)/2)
@ -108,7 +107,7 @@ def main():
#print(phase.degrees/360*100)
#print(putmoon(phase.degrees/360, 21, 'north' if args.lat > 0 else 'south'))
print(fmt(args.columns, t, az, el, phase, illum, moonrise, transit, moonset, hemi))
print(fmt(args.columns, t, az, el, phase, illum, moonrise, transit, moonset, args.lines - 4,hemi))
#print(putmoon(phase.degrees/360, 21, '@', hemi))
main()