Commit 811557e4 authored by Laura Ketzer's avatar Laura Ketzer
Browse files

minor edits in results notebook

parent d8ba4ca3
%% Cell type:code id: tags:
 
``` python
# last worked on 4.6.2020
# last worked on 5.6.2020
```
 
%% Cell type:markdown id: tags:
 
# Import
......@@ -46,7 +46,7 @@ def read_in_PLATYPOS_results(path_to_results, N_tracks):
planet_df_dict = {} # dictionary of results, with planet names as keys, and corresponding results-dataframes as values
tracks_dict = {} # dictionary with planet names as keys, and list of track infos for each planet folder as values
planet_init_dict = {} # dictionary of initial planet parameters,with planet names are keys, parameters the values
for i, f in enumerate(non_empty_folders):
# f: folder name
# get all files in one planet directory
......@@ -115,6 +115,37 @@ def read_in_PLATYPOS_results(path_to_results, N_tracks):
return planet_df_dict, planet_init_df, tracks_dict
def read_in_host_star_parameters(path_to_results):
""" Initial stellar parameters. """
files = os.listdir(path_to_results)
print("Total # of planet folders = ", len(files))
# check for empty folders (where maybe sth went wrong)
non_empty_folders = []
for f in files:
if len(os.listdir(path_to_results+f)) == 0:
pass
elif len([file for file in os.listdir(path_to_results+f) if f in file and "track" in file])==0:
# this means no output file has been produced by PLATYPOS for any of the tracks
pass
else:
non_empty_folders.append(f)
print("Non-empty folders: ", len(non_empty_folders))
star_dict = {} # dictionary with star parameters, with planet names as keys, and star parameters as values
for i, f in enumerate(non_empty_folders):
# f: folder name
# get all files in one planet directory
all_files_in_f = [f for f in os.listdir(path_to_results+f) if not f.startswith('.')]
df_star = pd.read_csv(path_to_results+f+"/"+"host_star_properties"+".txt", float_precision='round_trip')
star_dict[f] = df_star.values[0]
# convert the planet_init_dict to a dataframe
star_df = pd.DataFrame.from_dict(star_dict, orient='index', columns=df_star.columns)
return star_df
def read_in_PLATYPOS_results_dataframe(path_to_results, N_tracks):
"""
Calls read_in_PLATYPOS_results & then does some more re-aranging to the data to make it easier to handle.
......
,planet,radii_p,radii_p_err_low,radii_p_err_upp,periods,masses,masses_err_low,masses_err_upp,radii_s,radii_s_err_low,radii_s_err_upp
0,Kepler-10b,1.473,-0.026,0.026,0.83749026,0.92,-0.02,0.92,1.0662,-0.0075,0.0069
1,Kepler-10c,2.323,-0.028,0.028,45.294292,0.92,-0.02,0.92,1.0662,-0.0075,0.0069
2,Kepler-23b,1.694,-0.076,0.076,7.106995,1.078,-0.077,1.078,1.548,-0.048,0.048
3,Kepler-23c,3.12,-0.1,0.1,10.742434,1.078,-0.077,1.078,1.548,-0.048,0.048
4,Kepler-23d,2.235,-0.088,0.088,15.27429,1.078,-0.077,1.078,1.548,-0.048,0.048
5,Kepler-25b,2.702,-0.037,0.037,6.2385369,1.16,-0.05,1.16,1.299,-0.016,0.015
6,Kepler-25c,5.154,-0.06,0.06,12.7203678,1.16,-0.05,1.16,1.299,-0.016,0.015
7,Kepler-37b,0.354,-0.014,0.014,13.36805,0.81,-0.01,0.81,0.7725,-0.0063,0.0051
8,Kepler-37c,0.705,-0.012,0.012,21.302071,0.81,-0.01,0.81,0.7725,-0.0063,0.0051
9,Kepler-37d,1.922,-0.024,0.024,39.792232,0.81,-0.01,0.81,0.7725,-0.0063,0.0051
10,Kepler-65b,1.409,-0.017,0.017,2.1549156,1.199,-0.03,1.199,1.401,-0.014,0.013
11,Kepler-65c,2.571,-0.033,0.033,5.8599408,1.199,-0.03,1.199,1.401,-0.014,0.013
12,Kepler-65d,1.506,-0.04,0.04,8.131231,1.199,-0.03,1.199,1.401,-0.014,0.013
13,Kepler-68b,2.354,-0.02,0.02,5.3987533,1.07,-0.02,1.07,1.2379,-0.0051,0.0067
14,Kepler-68c,0.927,-0.025,0.025,9.604979,1.07,-0.02,1.07,1.2379,-0.0051,0.0067
15,Kepler-92b,3.65,-0.13,0.13,13.748933,1.209,-0.03,1.209,1.719,-0.013,0.011
16,Kepler-92c,2.455,-0.053,0.053,26.72311,1.209,-0.03,1.209,1.719,-0.013,0.011
17,Kepler-92d,2.067,-0.056,0.056,49.3568,1.209,-0.03,1.209,1.719,-0.013,0.011
18,Kepler-100b,1.305,-0.03,0.03,6.887037,1.109,-0.02,1.109,1.5131,-0.011,0.0093
19,Kepler-100c,2.221,-0.022,0.022,12.815909,1.109,-0.02,1.109,1.5131,-0.011,0.0093
20,Kepler-100d,1.514,-0.034,0.034,35.33313,1.109,-0.02,1.109,1.5131,-0.011,0.0093
21,Kepler-103b,3.476,-0.039,0.039,15.965316,1.099,-0.03,1.099,1.455,-0.013,0.024
22,Kepler-103c,5.319,-0.052,0.052,179.6133,1.099,-0.03,1.099,1.45,-0.009,0.009
23,Kepler-107b,1.581,-0.056,0.056,3.180026,1.142,-0.068,1.142,1.411,-0.047,0.047
24,Kepler-107c,1.664,-0.065,0.065,4.901441,1.142,-0.068,1.142,1.411,-0.047,0.047
25,Kepler-107d,1.064,-0.062,0.062,7.95825,1.142,-0.068,1.142,1.411,-0.047,0.047
26,Kepler-107e,2.92,-0.1,0.1,14.749176,1.142,-0.068,1.142,1.411,-0.047,0.047
27,Kepler-108b,9.56,-0.53,0.53,49.18354,1.377,-0.089,1.377,2.19,-0.12,0.12
28,Kepler-108c,8.23,-0.47,0.47,190.3214,1.377,-0.089,1.377,2.19,-0.12,0.12
29,Kepler-109b,2.338,-0.034,0.034,6.481637,1.069,-0.04,1.069,1.339,-0.015,0.017
30,Kepler-109c,2.634,-0.043,0.043,21.22262,1.069,-0.04,1.069,1.339,-0.015,0.017
31,Kepler-126b,1.439,-0.02,0.02,10.495634,1.148,-0.049,1.148,1.345,-0.018,0.015
32,Kepler-126c,1.498,-0.062,0.062,21.86964,1.148,-0.049,1.148,1.345,-0.018,0.015
33,Kepler-126d,2.513,-0.031,0.031,100.28208,1.148,-0.049,1.148,1.345,-0.018,0.015
34,Kepler-127b,1.52,-0.13,0.13,14.43577,1.24,-0.086,1.24,1.359,-0.035,0.035
35,Kepler-127c,2.389,-0.067,0.067,29.39344,1.24,-0.086,1.24,1.359,-0.035,0.035
36,Kepler-127d,2.668,-0.084,0.084,48.62997,1.24,-0.086,1.24,1.359,-0.035,0.035
37,Kepler-129b,2.409,-0.04,0.04,15.791619,1.159,-0.03,1.159,1.649,-0.014,0.012
38,Kepler-129c,2.522,-0.066,0.066,82.1908,1.159,-0.03,1.159,1.649,-0.014,0.012
39,Kepler-130b,0.976,-0.045,0.045,8.45725,0.934,-0.059,0.934,1.127,-0.033,0.033
40,Kepler-130c,2.811,-0.084,0.084,27.508686,0.934,-0.059,0.934,1.127,-0.033,0.033
41,Kepler-130d,1.31,-0.13,0.13,87.5211,0.934,-0.059,0.934,1.127,-0.033,0.033
42,Kepler-145b,2.56,-0.28,0.28,22.95102,1.419,-0.03,1.419,1.887,-0.014,0.012
43,Kepler-145c,3.92,-0.11,0.11,42.88254,1.419,-0.03,1.419,1.887,-0.014,0.012
44,Kepler-197b,1.064,-0.038,0.038,5.599293,0.922,-0.059,0.922,1.12,-0.033,0.033
45,Kepler-197c,1.208,-0.048,0.048,10.349711,0.922,-0.059,0.922,1.12,-0.033,0.033
46,Kepler-197d,1.244,-0.049,0.049,15.67787,0.922,-0.059,0.922,1.12,-0.033,0.033
47,Kepler-197e,0.983,-0.048,0.048,25.2097,0.922,-0.059,0.922,1.12,-0.033,0.033
48,Kepler-278b,4.59,-0.26,0.26,30.15856,1.298,-0.076,1.298,2.935,-0.066,0.066
49,Kepler-278c,3.31,-0.12,0.12,51.0851,1.298,-0.076,1.298,2.935,-0.066,0.066
50,Kepler-338b,2.58,-0.13,0.13,13.72699,1.142,-0.084,1.142,1.735,-0.082,0.082
51,Kepler-338c,2.48,-0.14,0.14,24.31168,1.142,-0.084,1.142,1.735,-0.082,0.082
52,Kepler-338d,2.66,-0.15,0.15,44.4287,1.142,-0.084,1.142,1.735,-0.082,0.082
53,Kepler-338e,1.587,-0.083,0.083,9.34149,1.142,-0.084,1.142,1.735,-0.082,0.082
54,Kepler-444b,0.381,-0.021,0.021,3.600125,0.74,-0.01,0.74,0.7492,-0.004,0.0046
55,Kepler-444c,0.49,-0.024,0.024,4.545817,0.74,-0.01,0.74,0.7492,-0.004,0.0046
56,Kepler-444d,0.53,-0.025,0.025,6.189512,0.74,-0.01,0.74,0.7492,-0.004,0.0046
57,Kepler-444e,0.533,-0.019,0.019,7.7435,0.74,-0.01,0.74,0.7492,-0.004,0.0046
58,Kepler-444f,0.679,-0.008,0.008,9.740529,0.74,-0.01,0.74,0.7492,-0.004,0.0046
59,Kepler-449b,2.056,-0.069,0.069,12.58242,0.969,-0.053,0.969,1.467,-0.033,0.033
60,Kepler-449c,2.764,-0.086,0.086,33.6727,0.969,-0.053,0.969,1.467,-0.033,0.033
61,Kepler-450b,6.14,-0.33,0.33,28.454851,1.346,-0.084,1.346,1.57,-0.085,0.085
62,Kepler-450c,2.62,-0.14,0.14,15.413135,1.346,-0.084,1.346,1.57,-0.085,0.085
63,Kepler-450d,0.837,-0.068,0.068,7.51464,1.346,-0.084,1.346,1.57,-0.085,0.085
64,KOI-5b,7.87,-0.14,0.14,4.78032767,1.199,-0.03,1.199,1.795,-0.014,0.015
65,KOI-5c,0.642,-0.061,0.061,7.05174,1.199,-0.03,1.199,1.795,-0.014,0.015
66,TrES-2,13.21,-0.28,0.28,2.4706134,0.97,-0.08,0.97,0.96,-0.02,0.02
67,HAT-P-7,16.88,-0.26,0.26,2.20473543,1.55,-0.1,1.55,1.99,-0.03,0.03
68,HAT-P-11,4.887,-0.065,0.065,4.8878024,0.86,-0.06,0.86,0.76,-0.01,0.01
69,Kepler-4,4.22,-0.12,0.12,3.21367134,1.09,-0.07,1.09,1.55,-0.04,0.04
70,Kepler-410,2.786,-0.045,0.045,17.833613,1.22,-0.07,1.22,1.35,-0.02,0.02
71,Kepler-93,1.477,-0.033,0.033,4.7267393,0.89,-0.07,0.89,0.91,-0.02,0.02
72,K00075.01,10.72,-0.29,0.29,105.88162,1.32,-0.07,1.32,2.58,-0.07,0.07
73,Kepler-22,1.806,-0.029,0.029,289.8655,0.85,-0.05,0.85,0.83,-0.01,0.01
74,K00092.01,3.0,-0.13,0.13,65.70453,1.08,-0.11,1.08,1.05,-0.03,0.03
75,Kepler-7,17.68,-0.36,0.36,4.8854862,1.28,-0.07,1.28,1.97,-0.04,0.04
76,Kepler-14,12.87,-0.26,0.26,6.7901237,1.34,-0.08,1.34,2.02,-0.04,0.04
77,Kepler-464,3.44,-0.1,0.1,7.257038,1.2,-0.08,1.2,1.6,-0.04,0.04
78,Kepler-467,2.26,-0.09,0.09,24.99337,1.01,-0.07,1.01,1.36,-0.04,0.04
79,Kepler-95,3.29,-0.094,0.094,11.5230844,1.12,-0.08,1.12,1.45,-0.04,0.04
80,Kepler-506,3.088,-0.082,0.082,6.8834081,1.23,-0.1,1.23,1.2,-0.03,0.03
81,Kepler-96,2.647,-0.088,0.088,16.2384819,1.03,-0.1,1.03,0.94,-0.03,0.03
82,K00268.01,3.043,-0.076,0.076,110.38099648,1.2,-0.07,1.2,1.36,-0.03,0.03
83,K00269.01,1.549,-0.047,0.047,18.01181,1.33,-0.08,1.33,1.45,-0.02,0.02
84,Kepler-454,2.38,-0.094,0.094,10.573754,1.15,-0.11,1.15,1.1,-0.03,0.03
85,Kepler-509,2.67,-0.2,0.2,41.746009,1.05,-0.07,1.05,1.19,-0.02,0.02
86,K00280.01,2.19,-0.068,0.068,11.872877,1.03,-0.09,1.03,1.04,-0.02,0.02
87,Kepler-510,2.35,-0.077,0.077,19.556464,0.81,-0.11,0.81,1.38,-0.04,0.04
88,K00288.01,3.208,-0.055,0.055,10.275375,1.41,-0.08,1.41,2.09,-0.03,0.03
89,K00319.01,10.36,-0.25,0.25,46.15113,1.29,-0.06,1.29,2.08,-0.04,0.04
90,K00367.01,4.72,-0.15,0.15,31.578671,1.11,-0.09,1.11,1.03,-0.03,0.03
91,Kepler-540,2.947,-0.064,0.064,172.70681,0.88,-0.06,0.88,1.15,-0.02,0.02
92,Kepler-643,11.29,-0.78,0.78,16.338888,1.27,-0.22,1.27,2.78,-0.19,0.19
93,K00974.01,2.601,-0.06,0.06,53.50593,1.21,-0.08,1.21,1.85,-0.04,0.04
94,Kepler-21,1.707,-0.043,0.043,2.7858219,1.27,-0.08,1.27,1.85,-0.03,0.03
95,Kepler-805,2.611,-0.095,0.095,30.8633,1.08,-0.07,1.08,1.59,-0.03,0.03
96,Kepler-432,14.7,-2.1,2.1,52.5019,1.69,-0.6,1.69,4.51,-0.63,0.63
97,Kepler-815,4.98,-0.6,0.6,8.57522,1.69,-0.5,1.69,3.88,-0.43,0.43
98,Kepler-407,1.141,-0.041,0.041,0.6693127,1.02,-0.07,1.02,1.02,-0.02,0.02
99,Kepler-408,0.689,-0.017,0.017,2.465024,1.02,-0.07,1.02,1.21,-0.02,0.02
100,Kepler-907,1.403,-0.081,0.081,15.86631,0.99,-0.08,0.99,1.34,-0.03,0.03
101,Kepler-910,0.828,-0.049,0.049,2.364388,1.29,-0.09,1.29,1.5,-0.03,0.03
102,Kepler-911,2.44,-0.11,0.11,20.30895,1.22,-0.08,1.22,1.93,-0.04,0.04
103,Kepler-997,1.304,-0.072,0.072,2.707295,1.09,-0.18,1.09,1.48,-0.07,0.07
104,Kepler-1002,1.609,-0.046,0.046,4.336422,1.18,-0.07,1.18,1.54,-0.02,0.02
105,Kepler-409,1.148,-0.048,0.048,68.95825,0.95,-0.08,0.95,0.9,-0.02,0.02
106,K01962.01,2.51,-0.14,0.14,32.85861,1.04,-0.07,1.04,1.5,-0.04,0.04
107,K01964.01,0.668,-0.029,0.029,2.2293226,0.93,-0.11,0.93,0.88,-0.03,0.03
108,Kepler-1219,3.42,-0.37,0.37,16.1046,1.38,-0.5,1.38,2.68,-0.25,0.25
109,K02462.01,1.491,-0.083,0.083,12.14533,1.19,-0.1,1.19,1.71,-0.04,0.04
110,Kepler-1274,1.441,-0.071,0.071,6.98156,1.38,-0.07,1.38,2.16,-0.04,0.04
111,Kepler-1298,1.588,-0.089,0.089,7.12836,1.37,-0.17,1.37,2.16,-0.07,0.07
112,K02706.01,1.797,-0.082,0.082,3.097597,1.26,-0.18,1.26,1.86,-0.08,0.08
113,Kepler-1392,0.684,-0.052,0.052,2.128229,0.99,-0.15,0.99,1.3,-0.06,0.06
114,K02801.01,0.87,-0.061,0.061,6.9918,1.12,-0.17,1.12,1.45,-0.06,0.06
115,Kepler-1394,1.04,-0.11,0.11,3.938,1.51,-0.21,1.51,1.98,-0.08,0.08
116,K03168.01,0.988,-0.076,0.076,56.382,1.03,-0.16,1.03,1.55,-0.07,0.07
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment