identify_unknown_sptypes: add colorcoding to the output

This commit is contained in:
2024-12-02 10:01:05 +01:00
parent 34261b9581
commit db3c8be556
+15 -5
View File
@@ -1,6 +1,16 @@
from astroquery.simbad import Simbad
import pandas as pd
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
simbad = Simbad()
bvStars = ["1RXS J064643.6-770027", "BD-08 995", "CPD-19 878", "PM J07058-5848", "TYC 1360-957-1", "TYC 4595-107-1"]
@@ -69,13 +79,13 @@ for star in bvStars:
bestMatchIndexUBVonlyWeighted = distancesUBVonlyWeighted.idxmin()
bestMatchNameUBVonlyWeighted = spTypeTable.iloc[bestMatchIndexUBVonlyWeighted, 0]
print(f"--- {star['MAIN_ID'].value[0]} ---")
print("Table entry: ")
print(f"--- {bcolors.BOLD}{bcolors.OKGREEN}{star['MAIN_ID'].value[0]}{bcolors.ENDC} ---")
print(f"Best no weights match: {bcolors.FAIL}{bestMatchNameUBV}{bcolors.ENDC}")
print(spTypeTable.iloc[bestMatchIndexUBVIJHK:bestMatchIndexUBVIJHK+1])
print("Weighted Table entry:")
print(f"Best weights match: {bcolors.FAIL}{bestMatchNameUBVweighted}{bcolors.ENDC}")
print(spTypeTable.iloc[bestMatchIndexUBVIJHKweighted:bestMatchIndexUBVIJHKweighted+1])
print("UBV Table entry:")
print(f"Best UBV match: {bcolors.FAIL}{bestMatchNameUBVonlyWeighted}{bcolors.ENDC}")
print(spTypeTable.iloc[bestMatchIndexUBVonlyWeighted:bestMatchIndexUBVonlyWeighted+1])
print("Star: ")
print(f"Star: ")
print(fluxDiff)
print("-------------------------------------------------------------------------------------")