def planetAndStar(how='inner'):
"""Read the SWEET-Cat and ExoplanetEU databases and merge them.
Input
-----
how : str (default: 'inner')
How to merge the two DataFrames. See pd.merge for documentation
Output
------
d : pd.DataFrame
The DataFrame of merged DataFrame
c : list
The columns that can be used for plotting
"""
df, columns = readSC()
deu = readExoplanetEU()
cols = ['stName', 'plMass', 'plRadius', 'period', 'sma', 'eccentricity',
'inclination', 'discovered', 'dist', 'b',
'mag_v', 'mag_i', 'mag_j', 'mag_h', 'mag_k', 'plDensity']
d = pd.merge(df, deu, left_on='Star', right_on='stName', how=how)
d['radius'] = list(map(stellar_radius, d['mass'], d['logg']))
d['teq0'] = d.teff * np.sqrt((d.radius*700000)/(2*d.sma*150000000))
c = columns + cols[1:]
return d, c
评论列表
文章目录