flaredetector: add file to show starts with unknown spectral type
This commit is contained in:
@@ -0,0 +1,90 @@
|
|||||||
|
from main.astrodatadownloader.astrodatadownloader import *
|
||||||
|
from main.astrodatagui.db.StarsDB import StarDB
|
||||||
|
from astroquery.simbad import Simbad
|
||||||
|
import concurrent.futures
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
DEFAULT_DB = "stars.db"
|
||||||
|
|
||||||
|
starDB: StarDB = StarDB.getInstance(DEFAULT_DB)
|
||||||
|
simbad = Simbad()
|
||||||
|
simbad.add_votable_fields("sptype")
|
||||||
|
simbad.add_votable_fields("velocity")
|
||||||
|
simbad.add_votable_fields("diameter")
|
||||||
|
simbad.add_votable_fields("distance")
|
||||||
|
|
||||||
|
allUnknownStars = starDB.getAllStarsWithSpType("-")
|
||||||
|
print(allUnknownStars)
|
||||||
|
gaiaNames = []
|
||||||
|
|
||||||
|
for star in allUnknownStars:
|
||||||
|
altNames = starDB.getStarAltNames(star)
|
||||||
|
for altName in altNames[:-1]:
|
||||||
|
if(altName[0].startswith("Gaia DR3")):
|
||||||
|
gaiaNames.append({"mainName": star,
|
||||||
|
"gaiaName": altName[0]})
|
||||||
|
break
|
||||||
|
|
||||||
|
gaiaNames = pd.DataFrame(gaiaNames)
|
||||||
|
|
||||||
|
kicNames = []
|
||||||
|
|
||||||
|
for star in allUnknownStars:
|
||||||
|
altNames = starDB.getStarAltNames(star)
|
||||||
|
for altName in altNames[:-1]:
|
||||||
|
if(altName[0].startswith("KIC")):
|
||||||
|
kicNames.append({"mainName": star,
|
||||||
|
"kicName": altName[0]})
|
||||||
|
break
|
||||||
|
|
||||||
|
kicNames = pd.DataFrame(kicNames)
|
||||||
|
|
||||||
|
nonGaiaStars = []
|
||||||
|
for star in allUnknownStars:
|
||||||
|
if(star not in gaiaNames["mainName"].values):
|
||||||
|
nonGaiaStars.append({"mainName": star})
|
||||||
|
nonGaiaStars = pd.DataFrame(nonGaiaStars)
|
||||||
|
|
||||||
|
nonKicStars = []
|
||||||
|
for star in allUnknownStars:
|
||||||
|
if(star not in gaiaNames["mainName"].values):
|
||||||
|
nonKicStars.append({"mainName": star})
|
||||||
|
nonKicStars = pd.DataFrame(nonKicStars)
|
||||||
|
|
||||||
|
|
||||||
|
#print(gaiaNames)
|
||||||
|
#print(nonGaiaStars)
|
||||||
|
print(kicNames)
|
||||||
|
#print(nonKicStars)
|
||||||
|
|
||||||
|
KeplerM = pd.read_csv("D:/Masterthesis/ressources/akthukair_AFD/Results/M-type-superflares.csv")
|
||||||
|
KeplerK = pd.read_csv("D:/Masterthesis/ressources/akthukair_AFD/Results/K-type-superflares.csv")
|
||||||
|
KeplerG = pd.read_csv("D:/Masterthesis/ressources/akthukair_AFD/Results/G-type-superflares.csv")
|
||||||
|
KeplerF = pd.read_csv("D:/Masterthesis/ressources/akthukair_AFD/Results/F-type-superflares.csv")
|
||||||
|
KeplerA = pd.read_csv("D:/Masterthesis/ressources/akthukair_AFD/Results/A-type-superflares.csv")
|
||||||
|
|
||||||
|
#kicBasedSP = []
|
||||||
|
#for fullKIC in kicNames["kicName"].values:
|
||||||
|
# kic = int(fullKIC[4:])
|
||||||
|
# if(kic in KeplerM["kepler_id"].values):
|
||||||
|
# kicBasedSP.append("M")
|
||||||
|
# elif(kic in KeplerK["kepler_id"].values):
|
||||||
|
# kicBasedSP.append("K")
|
||||||
|
# elif(kic in KeplerG["kepler_id"].values):
|
||||||
|
# kicBasedSP.append("G")
|
||||||
|
# elif(kic in KeplerF["kepler_id"].values):
|
||||||
|
# kicBasedSP.append("F")
|
||||||
|
# elif(kic in KeplerA["kepler_id"].values):
|
||||||
|
# kicBasedSP.append("A")
|
||||||
|
# else:
|
||||||
|
# print("No Match")
|
||||||
|
# kicBasedSP.append("-")
|
||||||
|
|
||||||
|
#kicNames["spType"] = kicBasedSP
|
||||||
|
|
||||||
|
#print(kicNames)
|
||||||
|
#for ind, row in kicNames.reset_index().iterrows():
|
||||||
|
# mainName = row["mainName"]
|
||||||
|
# spType = row["spType"]
|
||||||
|
# starDB.updateStarInfoSpType(mainName, spType)
|
||||||
Reference in New Issue
Block a user