Skip to content

Instantly share code, notes, and snippets.

@sumanchapai
Created May 27, 2023 15:27
Show Gist options
  • Save sumanchapai/0eec38708d46a49c5f57bcea128bd7b6 to your computer and use it in GitHub Desktop.
Save sumanchapai/0eec38708d46a49c5f57bcea128bd7b6 to your computer and use it in GitHub Desktop.
Luther Astrophysics. Brightness duplicate
# Boilerplate to allow importing `trout`
import sys
if ".." not in sys.path:
sys.path.append("..")
if "." not in sys.path:
sys.path.append(".")
from trout.exceptions import StarNotPresentInReferenceException
from trout.stars import Star
from trout.stars.utils import STAR_END, STAR_START
print(f"{'Star':<10s}{'Duplicate': ^20s}{'Distance':^20s}", flush=True)
for s in range(STAR_START, STAR_END):
try:
d = Star(s).brightest_duplicate()
if d:
print(f"{s:<10}{d[0]:^20}{d[1]:^20.5f}", flush=True)
except StarNotPresentInReferenceException:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment